Skip to content

[Bug]: Silent refresh fails using localStorage when multiple tabs trying to refresh at the same time #1838

@Coldfen

Description

@Coldfen

Version

16.0.0

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

myConfigId - silent renew failed! Error: Error: authorizedCallback, token(s) validation failed, resetting.

Steps to reproduce the behavior

1) Set up OIDC Code Flow PKCE using refresh tokens (used 'ng add angular-auth-oidc-client')

2) Set up custom storage using localStorage (used example from https://angular-auth-oidc-client.com/docs/documentation/custom-storage)

3) To speed up testing, setup your authority to have short lived access and refresh tokens. (i.e. 30 - 50 seconds) 

4) Login using one browser [chrome] tab (i.e. this.oidcSecurityService.authorize()). Open console and verify refresh is working

5) Open a few more tabs. Open console and verify they are authorized and refreshing (in my case i open 6 or more)

6) Wait until error occurs. It shouldn't take long - usually 2-20 minutes with 30 - 40 seconds tokens. Open more tabs if needed.

A clear and concise description of what you expected to happen.

Access token should refresh successfully and all tabs remain authorized

Additional context

The same problem was described in #1662

image

A temporary solution does not suit me well, because my token functions for 300 seconds.

My config:
image

AuthConfigModule added to the imports of the main AppModule.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions