Skip to content
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

docs: clarify graceful refresh token rotation #1959

Merged
merged 3 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions docs/hydra/guides/graceful-token-refresh.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,21 @@ with new tokens for each request without immediate invalidation of the original

## Example behavior with grace period

- **Using the refresh token within the grace period**: If a refresh token is used twice within the configured grace period (for
When the user calls `/oauth2/auth` and performs login and consent, the OAuth2 server issues an access token and a refresh token.
These tokens and all subsequent tokens issued within the grace period are part of the same consent request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The phrase "consent request" is, I think, a Hydra implementation artifact.

Maybe some day we can clarify the concepts both in documenation and in code.

It's a difficult thing to wrap your head around. This is just a side remark.

This PR is 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I actually struggled quite hard in trying to find the right phrase. Is it login request? consent request? token chain? consent flow? authorized consent id? Haven't found a good solution yet.


- Using the refresh token within the grace period: If a refresh token is used twice within the configured grace period (for
example, 60 seconds), each usage results in a new set of access and refresh tokens.
- **Revocation implications**: Any refresh token issued within the grace period is part of the same token chain. Revoking one
token or consent associated with the chain will revoke all tokens in the chain, including those issued through graceful refresh.
- Revocation implications: Any refresh token issued within the grace period is part of the same consent request. Revoking one
token, or when the user revokes their consent, all tokens belonging to the original consent request, including those issued
through a graceful refresh, are invalidated.
- Re-use detection: If a refresh token is used, and then used again after the grace period ends, re-use detection will revoke all
tokens linked to the consent request.
- Token rotation: When a refresh token is used, the access token it was issued with will be revoked. Other access tokens will not
be revoked unless one of the above conditions is met. This prevents cases where two competing clients are invalidating one
other's tokens.
aeneasr marked this conversation as resolved.
Show resolved Hide resolved

The grace period cannot exceed 5 minutes.

## Use cases for graceful refresh token rotation

Expand Down
Loading