Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

Fix reuse refresh token flow #1668

Closed

Conversation

czeroprime
Copy link

@czeroprime czeroprime commented Apr 29, 2019

Fixes: #1193 #1109

This update fixes an issue with the refresh token flow when the 'reuseRefreshToken' flag is true.

Description of issue:
If the 'reuseRefreshToken' flag is true, and 'supportRefreshToken' flag is true, when refreshing the access token the refresh token changes also(it updates the 'ati' property with the id of the new access token). This new refresh token is referenced against the access token when stored, but the new refresh token itself is not stored, and the original refresh token not being linked to an existing access token. This results in refresh tokens being single use, and being orphaned after use. More information on the issue present in #1193

Fix:
The fix removes the existing refresh token, and stores the new refresh token.

@RazmikMkrtchyan
Copy link

RazmikMkrtchyan commented Oct 24, 2019

This way reuseRefreshToken not works properly. Every time generates new refresh token. I have resovled issued by removing encode function from refresh token. Is it bad solution?

@czeroprime
Copy link
Author

Hi @RazmikMkrtchyan, @dcoffin pointed out in issue #1109 the spec does in fact say that a new refresh token can be returned on refresh.
I reference this and expand on it a little in issue #1193.

@jgrandja
Copy link
Contributor

Closing this PR. Please see this comment

@jgrandja jgrandja closed this Oct 25, 2019
@jgrandja jgrandja self-assigned this Oct 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

JwtAccessTokenConverter will change the refreshToken even when reuseRefreshToken set to true
3 participants