-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Problem
When max_age is used in an authorization request, the OIDC conformance test CheckIdTokenAuthTimeClaimsSameIfPresent fails because two id_tokens from the same authentication session contain different auth_time values.
Test: oidc-max-age-10000 (OpenID Foundation conformance suite v5.1.39)
Steps to reproduce
- Client sends authorization request with
max_age=15000— user authenticates with password - Client sends second authorization request with
max_age=10000— server reuses the existing session (SSO) - Compare
auth_timein both id_tokens
Expected: Both id_tokens have the same auth_time (user only authenticated once).
Actual: The values differ by several seconds.
Root cause
In handler_auth_completed.go, the return values from BumpUserSession and StartNewUserSession are discarded:
_, err = userSessionManager.BumpUserSession(...)
_, err = userSessionManager.StartNewUserSession(...)Since authContext.AuthenticatedAt is never set, code_issuer.go falls back to time.Now() at code creation time — several seconds after the session was actually created.
On the second request, the SSO path in handler_authorize.go correctly copies session.AuthTime into the id_token. This creates the mismatch:
- First id_token:
auth_time= code creation time (T + N seconds) - Second id_token:
auth_time= session's originalAuthTime(T)