Skip to content

Relax auth_time validation on ID token refresh#18850

Open
answndud wants to merge 1 commit intospring-projects:mainfrom
answndud:fix/auth-time-refresh-validation-18839
Open

Relax auth_time validation on ID token refresh#18850
answndud wants to merge 1 commit intospring-projects:mainfrom
answndud:fix/auth-time-refresh-validation-18839

Conversation

@answndud
Copy link

@answndud answndud commented Mar 5, 2026

When an OP refreshes an ID token and updates auth_time (for example after SSO session renewal), strict equality with the previous ID token can reject an otherwise valid refreshed token.

This change relaxes that check in both servlet and reactive paths:

  • keep issuer/sub/aud/nonce checks as-is
  • validate auth_time is not after refreshed token iat (with configured clock skew)

Updated tests:

  • OidcAuthorizedClientRefreshedEventListenerTests
  • RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandlerTests

Verification:

  • ./gradlew -PtestToolchain=21 -PtestCompileTargetVersion=21 :spring-security-oauth2-client:test --tests "org.springframework.security.oauth2.client.oidc.authentication.OidcAuthorizedClientRefreshedEventListenerTests" --tests "org.springframework.security.oauth2.client.RefreshOidcUserReactiveOAuth2AuthorizationSuccessHandlerTests" -x :spring-security-javascript:nodeSetup -x :spring-security-javascript:npmInstall -x :spring-security-javascript:npm_run_assemble -x :spring-security-javascript:assemble

Fixes #18839

Signed-off-by: MJY <jmoon0227@gmail.com>
@answndud answndud force-pushed the fix/auth-time-refresh-validation-18839 branch from 851c33d to 0b5f175 Compare March 5, 2026 04:24
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 5, 2026
@answndud
Copy link
Author

Hi team, friendly follow-up on this PR. If you'd prefer a different direction or any changes, I'm happy to update it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auth_time validation fails when SSO session is renewed

2 participants