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

Grace period incompatible with token rotation #702

Closed
Maronato opened this issue Apr 10, 2019 · 1 comment
Closed

Grace period incompatible with token rotation #702

Maronato opened this issue Apr 10, 2019 · 1 comment

Comments

@Maronato
Copy link
Contributor

Maronato commented Apr 10, 2019

This has been discussed on #631, but I think the merged solution(#660) does not fix it.

From what I understand, the objective of the grace period is to allow clients to send another refresh_token request using the same refresh token and get the newly generated access token back every time during such period.

The problem with #660 is that it only makes sure the new access token is returned, not the new refresh token generated by the token rotation.

This means that all refresh_token requests made during the grace period will return the revoked refresh token instead of the new one generated during the first refresh_token request. As such, if the client loses the new refresh token returned during the first call, it won't be able to renew tokens anymore.

To illustrate, assume we have a pair of access-refresh(A1, R1) tokens that we want to refresh.
This is the current behavior:

First refresh

  • R1 is sent to /o/token/
  • R1 is revoked
  • /o/token/ returns a pair (A2, R2) of new access and refresh tokens (per token rotation)

Second refresh (during grace period)

  • R1 is sent to /o/token/
  • R1 is already revoked
  • /o/token/ returns a pair (A2, R1) of the new access token and the old, revoked refresh token

Shouldn't the second refresh call return (A2, R2)? Is this the desired behavior?
If not, I already have a fix and will create a pull request.

@auvipy
Copy link
Contributor

auvipy commented Apr 10, 2019

please create a PR and let's discuss there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants