Revoke the access token before completing sign out - #1
Closed
brionmario wants to merge 1 commit into
Closed
Conversation
Adds tokenLifecycle.revokeToken.revokeOnSignOut config (default true) so signOut() revokes the access token at the OP's revocation_endpoint before clearing the local session. Revocation is best-effort: failures don't block sign out since the local session is cleared regardless.
|
Owner
Author
|
Superseded by thunder-id#70, opened against the correct upstream repo. |
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.
Purpose
signOut()only cleared the local session and, when RP-Initiated Logout is enabled, redirected to the OP'send_session_endpoint. It never revoked the access token itself, so a client-side sign out could leave the token valid at the OP.Approach
Adds a
tokenLifecycle.revokeToken.revokeOnSignOutconfig (defaulttrue) and hassignOut()revoke the access token at the OP'srevocation_endpointfirst, before the existing RP-Initiated Logout / local-only sign-out logic runs.Revocation is best-effort: if it fails (no
revocation_endpointadvertised, network error, non-200 response — e.g. for non-OAuth sessions), the error is caught and logged at debug level, and sign out proceeds exactly as it did before, since the local session must be cleared regardless.Set
tokenLifecycle: { revokeToken: { revokeOnSignOut: false } }to opt out and skip revocation entirely.Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks