-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RefreshTokenGrant: add option whether to revoke refreshed access tokens #1377
base: master
Are you sure you want to change the base?
RefreshTokenGrant: add option whether to revoke refreshed access tokens #1377
Conversation
Some additional thoughts:
The current implementation does not allow to obtain additional access tokens as it revokes all previous ones. |
We already have a function for this called The boolean should be set in the AuthServer class. Thank you for your PR though. I hope this functionality helps solve your problem. |
Apologies I had missed this. Will reopen to review later. Thanks for clarifying. |
Is there any progress on clarifying this PR? @Sephster |
No not yet. All my efforts are on releasing v9 then this will be picked up along with others. Cheers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the particular token is a refresh token and the authorization server supports the revocation of access tokens, then the authorization server SHOULD also invalidate all access tokens based on the same authorization grant. If the token passed to the request is an access token, the server MAY revoke the respective refresh token as well.
It means:
- When revoking a refresh token, the access token SHOULD also be revoked.
- When revoking an access token, the refresh token MAY also be revoked.
Co-authored-by: Hafez Divandari <[email protected]>
Currently, the
RefreshTokenGrant
immediately revokes an access token when it gets refreshed.The RFC Section 6 makes no mention that this should happen.
The current behavior sometimes causes issues: Some clients assume the old access token is still valid because it has not reached its expiration date yet. Also, there are race conditions with simultaneous requests when one client refreshes the token and the other client still uses the old, non-expired token.
This PR adds an option
revokeRefreshedAccessTokens
to configure revoking old access token after refreshing. It defaults totrue
, wich is the current behaviour.Also see #1347