Skip to content
This repository was archived by the owner on Feb 23, 2025. It is now read-only.

Test & Fix for issue #266: Refresh tokens with sliding refresh tokens #303

Conversation

jochenz
Copy link
Contributor

@jochenz jochenz commented Apr 17, 2021

You can reproduce the race condition using the tests in commit 599f810.
The last commit (21c8f1c) fixes the race condition.

The race condition only occurs when using refresh tokens with sliding expiration.
Because for these refresh tokens, the refresh token gets immediately invalidated when another thread uses the refresh token to get a new access token.

@jochenz
Copy link
Contributor Author

jochenz commented Apr 17, 2021

Hmmm. A case of "works on my machine", even though it was tried with much higher concurrency and iteration count...
Curious what causes this.

At least the test does demonstrate the race condition.

@jochenz jochenz marked this pull request as draft April 17, 2021 14:49
@jochenz
Copy link
Contributor Author

jochenz commented Apr 17, 2021

Reproduced "on the local machine" too :-)

…appens when using refresh tokens with sliding expirations)"

This reverts commit 21c8f1c.
This reverts commit a773a6c.
Consistently green on the local machine.
@jochenz jochenz marked this pull request as ready for review April 17, 2021 15:17
@leastprivilege
Copy link
Contributor

thanks!

@leastprivilege leastprivilege merged commit d1609bf into DuendeArchive:main May 2, 2021
@github-actions
Copy link

github-actions bot commented May 3, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants