Skip to content

fix(saml): emit assertion timestamps in UTC (Zulu) form#73

Merged
BK1031 merged 1 commit into
mainfrom
bk1031/fix-saml-utc-timestamps
Jun 4, 2026
Merged

fix(saml): emit assertion timestamps in UTC (Zulu) form#73
BK1031 merged 1 commit into
mainfrom
bk1031/fix-saml-utc-timestamps

Conversation

@BK1031
Copy link
Copy Markdown
Contributor

@BK1031 BK1031 commented Jun 4, 2026

samlsp.com rejected the SAML Response with:

invalid_response
time data 2026-06-04T15:48:59.458-07:00 does not match format yyyy-mm-ddThh:mm:ss(\.s+)?Z

The saml pod runs in America/Los_Angeles (the ENV TZ inherited from oauth's Dockerfile). The timestamps we hand crewjam — req.Now (Conditions NotBefore/NotOnOrAfter + Response IssueInstant) and session.CreateTime/ExpireTime (AuthnInstant) — were therefore zoned, and crewjam's xsd:dateTime layout (...Z07:00) renders a zone offset literally. Strict SPs require the Zulu ...Z form.

JWTs were unaffected because they use numeric epochs; only SAML serializes dateTime strings, so this is SAML-specific.

  • force req.Now and the session times to .UTC() (crewjam's own TimeNow is already UTC)
  • verified: the ...Z07:00 layout renders 2026-06-04T15:48:59.458-07:00 for an LA time vs 2026-06-04T22:48:59.458Z for UTC — the latter matches the SP's expected format

Needs release + redeploy.

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.
@BK1031 BK1031 merged commit b0208e8 into main Jun 4, 2026
15 checks passed
@BK1031 BK1031 deleted the bk1031/fix-saml-utc-timestamps branch June 4, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant