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

Single use Refresh Token over multiple Tabs #1648

Open
ch-lepp opened this issue Sep 3, 2024 · 1 comment
Open

Single use Refresh Token over multiple Tabs #1648

ch-lepp opened this issue Sep 3, 2024 · 1 comment

Comments

@ch-lepp
Copy link

ch-lepp commented Sep 3, 2024

Per default, the oidc-client-ts lib uses the browser session storage to store tokens.
When opening parts of my application in a new tab via the window.open() command, the content of the session storage is copied to the other tab unless explicitly told to do otherwise.

This means, given the default situation, the two tabs now use the same tokens.

The new OAuth2.1 strongly recommends to use refresh tokens only once.
This causes an issue if two or more tabs rely on the same refresh token. The first tab can use the refresh token to obtain a new access token, but the second tab will run into an error "refresh token already used"...

Is there a way to circumvent this problem?
I have seen that the oidc-client-lib allows to configure different storages.
However, I tried to use the provided InMemoryWebStorage but couldn't log in, since that storage doesn't seem to survive browser redirects...

@zach-betz-hln
Copy link

Related: #430

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