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

Issue with Refresh Token Rotation in oidc-client-ts: Concurrent Execution Problem in signinSilent() #1618

Open
Lucklj521 opened this issue Aug 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Lucklj521
Copy link

Hello there,

I've been using the oidc-client-ts package, and I've encountered an issue regarding the support for refresh token rotation. This feature is a requirement for being able to securely store refresh tokens on the client side, and it's an important security measure that we currently have to disable, which unfortunately lowers our security standards.

Apart from the multiple tabs issue mentioned in #430, we've identified another problem that we hope can be addressed alongside. The issue is described as follows:

Currently, signinSilent() lacks a mechanism to prevent concurrent executions. When signinSilent() is executed concurrently, it attempts to use the same refresh token for multiple requests. However, due to refresh token rotation being enabled, subsequent requests fail because the refresh token has already been used to obtain a new access token and refresh token.

In scenarios where automatic silent renewal is enabled, there are timer tasks set to refresh tokens periodically. This makes it impractical to manually trigger signinSilent() as concurrent executions are inevitable. As a result, in certain situations, such as when the browser is just activated, it becomes impossible to manually trigger signinSilent(), and we have to rely on the automatic refresh mechanism.

Implementing a mechanism within signinSilent() to prevent concurrent executions could potentially resolve this issue. This would ensure that only one refresh operation is ongoing at any given time, thereby avoiding the aforementioned problems.

Looking forward to your assistance in addressing this matter. Thank you for your time and consideration.

@pamapa
Copy link
Member

pamapa commented Aug 20, 2024

related to #430

@pamapa pamapa added the bug Something isn't working label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants