fix(saml): emit assertion timestamps in UTC (Zulu) form#73
Merged
Conversation
The saml pod runs in America/Los_Angeles (ENV TZ from the Dockerfile), so the times we hand crewjam (req.Now for Conditions/IssueInstant, session CreateTime/ExpireTime for AuthnInstant) carried a -07:00 offset. crewjam's xsd:dateTime layout (...Z07:00) renders that offset literally, and strict SPs require the Zulu '...Z' form — samlsp.com rejected the response with 'time data ...-07:00 does not match format ...Z'. Force these times to UTC; crewjam's own TimeNow is already UTC.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
samlsp.com rejected the SAML Response with:
The saml pod runs in
America/Los_Angeles(theENV TZinherited from oauth's Dockerfile). The timestamps we hand crewjam —req.Now(Conditions NotBefore/NotOnOrAfter + Response IssueInstant) andsession.CreateTime/ExpireTime(AuthnInstant) — were therefore zoned, and crewjam'sxsd:dateTimelayout (...Z07:00) renders a zone offset literally. Strict SPs require the Zulu...Zform.JWTs were unaffected because they use numeric epochs; only SAML serializes dateTime strings, so this is SAML-specific.
req.Nowand the session times to.UTC()(crewjam's ownTimeNowis already UTC)...Z07:00layout renders2026-06-04T15:48:59.458-07:00for an LA time vs2026-06-04T22:48:59.458Zfor UTC — the latter matches the SP's expected formatNeeds release + redeploy.