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

automaticSilentRenew with stored data creates two Auth instances #390

Closed
creage opened this issue May 26, 2022 · 7 comments
Closed

automaticSilentRenew with stored data creates two Auth instances #390

creage opened this issue May 26, 2022 · 7 comments
Labels
question Further information is requested

Comments

@creage
Copy link

creage commented May 26, 2022

Here is the scenario:

  • User authorizes once, the data gets stored in session storage.
  • Without closing the browser, user reloads the application.

Now, since the automaticSilentRenew is true by default, the OIDC will try to renew the token automatically. The problem is that it tries to do that TWICE, for some odd reason.

And both of the times, it sends same payload. So, the first request passes, but second one always fails, since the refresh token is obsolete now.

But, disabling the automaticSilentRenew and doing it manually works just fine:

// disable default auto-renew in config
automaticSilentRenew: false


// then down in the child component

const auth = useAuth();

useEffect(() => {
    // make renew manually
    return auth.events.addAccessTokenExpiring(() => {
	auth.signinSilent();
    });
}, [auth]);

This way only one refresh request gets called per application.

This issue doesn't appear if user closes the browser (session storage gets destroyed), and reopens it.

@pamapa
Copy link
Member

pamapa commented May 29, 2022

Does not happen in my application. Please enable debug log and verify where the problem comes from.

Logging: https://authts.github.io/oidc-client-ts/#logging

@creage
Copy link
Author

creage commented May 29, 2022

@pamapa Will check, thanks.

P.S. Could it be because of React 18 having Strict mode on in development? I see this change hitting a lot of people these days :)

@pamapa
Copy link
Member

pamapa commented May 29, 2022

P.S. Could it be because of React 18 having Strict mode on in development? I see this change hitting a lot of people these days :)

Maybe. I just saw this MR auth0/auth0-react#355, i guess we need the same, could that be your problem?

@jamesmeneghello
Copy link

Can confirm, happens for us using React 17. On a new page, silent renew is singular. After refreshing, it's duplicated.

New page:

oidc-client-ts.js:48 [UserManager] startSilentRenew: begin
oidc-client-ts.js:48 [SilentRenewService] start: begin
oidc-client-ts.js:48 [UserManager] getUser: begin
oidc-client-ts.js:48 [UserManager] _loadUser: begin
oidc-client-ts.js:48 [WebStorageStateStore] get('user:http://localhost:8180/realms/xxx:xxx'): begin
oidc-client-ts.js:48 [UserManager] startSilentRenew: begin
oidc-client-ts.js:48 [SilentRenewService] start: begin
oidc-client-ts.js:48 [UserManager] getUser: begin
oidc-client-ts.js:48 [UserManager] _loadUser: begin
oidc-client-ts.js:48 [WebStorageStateStore] get('user:http://localhost:8180/realms/xxx:xxx'): begin
oidc-client-ts.js:48 [OidcClient] readSigninResponseState: begin
oidc-client-ts.js:48 [WebStorageStateStore] get('xxx'): begin
2oidc-client-ts.js:48 [UserManager] _loadUser: no user storageString
oidc-client-ts.js:48 [SigninState.fromStorageString] begin
2oidc-client-ts.js:53 [UserManager] getUser: user not found in storage
oidc-client-ts.js:48 [UserManager] signinRedirectCallback: begin
oidc-client-ts.js:48 [UserManager] _signinEnd: begin
oidc-client-ts.js:48 [OidcClient] processSigninResponse: begin
oidc-client-ts.js:48 [OidcClient] readSigninResponseState: begin
oidc-client-ts.js:48 [WebStorageStateStore] remove('xxx'): begin
oidc-client-ts.js:48 [SigninState.fromStorageString] begin
oidc-client-ts.js:48 [OidcClient] processSigninResponse: received state from storage; validating response
oidc-client-ts.js:48 [ResponseValidator] validateSigninResponse: begin
oidc-client-ts.js:48 [ResponseValidator] _processSigninState: begin
oidc-client-ts.js:48 [ResponseValidator] _processSigninState: state validated
oidc-client-ts.js:48 [ResponseValidator] validateSigninResponse: state processed
oidc-client-ts.js:48 [ResponseValidator] _processCode: begin
oidc-client-ts.js:48 [ResponseValidator] _processCode: Validating code
oidc-client-ts.js:48 [TokenClient] exchangeCode: begin
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('token_endpoint'): begin
oidc-client-ts.js:48 [MetadataService] getMetadata: begin
oidc-client-ts.js:48 [MetadataService] getMetadata: getting metadata from http://localhost:8180/realms/xxx/.well-known/openid-configuration
oidc-client-ts.js:48 [JsonService] getJson: begin
oidc-client-ts.js:48 [JsonService] getJson: url: http://localhost:8180/realms/xxx/.well-known/openid-configuration
oidc-client-ts.js:48 [JsonService] getJson: HTTP response received, status 200
oidc-client-ts.js:48 [MetadataService] getMetadata: merging remote JSON with seed metadata
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('token_endpoint'): resolved
oidc-client-ts.js:48 [TokenClient] exchangeCode: got token endpoint
oidc-client-ts.js:48 [JsonService] postForm: begin
oidc-client-ts.js:48 [JsonService] postForm: url: http://localhost:8180/realms/xxx/protocol/openid-connect/token
oidc-client-ts.js:48 [JsonService] postForm: HTTP response received, status 200
oidc-client-ts.js:48 [TokenClient] exchangeCode: got response
oidc-client-ts.js:48 [ResponseValidator] validateSigninResponse: code processed
oidc-client-ts.js:48 [ResponseValidator] _validateIdTokenAttributes: begin
oidc-client-ts.js:48 [ResponseValidator] _validateIdTokenAttributes: decoding ID Token JWT
oidc-client-ts.js:48 [ResponseValidator] validateSigninResponse: tokens validated
oidc-client-ts.js:48 [ResponseValidator] _processClaims: begin
oidc-client-ts.js:48 [ResponseValidator] _processClaims: loading user info
oidc-client-ts.js:48 [UserInfoService] getClaims: begin
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('userinfo_endpoint'): begin
oidc-client-ts.js:48 [MetadataService] getMetadata: begin
oidc-client-ts.js:48 [MetadataService] getMetadata: using cached values
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('userinfo_endpoint'): resolved
oidc-client-ts.js:48 [UserInfoService] getClaims: got userinfo url http://localhost:8180/realms/xxx/protocol/openid-connect/userinfo
oidc-client-ts.js:48 [JsonService] getJson: begin
oidc-client-ts.js:48 [JsonService] getJson: token passed, setting Authorization header
oidc-client-ts.js:48 [JsonService] getJson: url: http://localhost:8180/realms/xxx/protocol/openid-connect/userinfo
oidc-client-ts.js:48 [JsonService] getJson: HTTP response received, status 200
oidc-client-ts.js:48 [UserInfoService] getClaims: got claims {xxx}
oidc-client-ts.js:48 [ResponseValidator] _processClaims: user info claims received from user info endpoint
oidc-client-ts.js:48 [ResponseValidator] _processClaims: user info claims received, updated profile: {xxx}
oidc-client-ts.js:48 [ResponseValidator] validateSigninResponse: claims processed
oidc-client-ts.js:48 [UserManager] _signinEnd: got signin response
oidc-client-ts.js:48 [UserManager] storeUser: begin
oidc-client-ts.js:48 [UserManager] storeUser: storing user
oidc-client-ts.js:48 [User] toStorageString: begin
oidc-client-ts.js:48 [WebStorageStateStore] set('user:http://localhost:8180/realms/xxx:xxx'): begin
oidc-client-ts.js:48 [UserManager] _signinEnd: user stored
oidc-client-ts.js:48 [UserManagerEvents] load: begin
oidc-client-ts.js:48 [UserManagerEvents] load: access token present, remaining duration: 60
oidc-client-ts.js:48 [UserManagerEvents] load: registering expiring timer, raising in 30 seconds
oidc-client-ts.js:48 [Timer('Access token expiring')] init: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] init: using duration 30
oidc-client-ts.js:48 [UserManagerEvents] load: registering expired timer, raising in 61 seconds
oidc-client-ts.js:48 [Timer('Access token expired')] init: begin
oidc-client-ts.js:48 [Timer('Access token expired')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expired')] init: using duration 61
oidc-client-ts.js:48 [Event('User loaded')] raise: User {xxx}
oidc-client-ts.js:53 [UserManager] signinRedirectCallback: success, signed in subject acfb7f0d-1395-4d1b-9fee-d2b9630b66af
ConfiguredAuthProvider.tsx:61 post-signin User {xxx}
oidc-client-ts.js:48 [UserManager] getUser: begin
oidc-client-ts.js:48 [UserManager] _loadUser: begin
oidc-client-ts.js:48 [WebStorageStateStore] get('user:http://localhost:8180/realms/xxx:xxx'): begin
oidc-client-ts.js:48 [UserManager] _loadUser: user storageString loaded
oidc-client-ts.js:48 [User.fromStorageString] begin
oidc-client-ts.js:53 [UserManager] getUser: user loaded
oidc-client-ts.js:48 [UserManagerEvents] load: begin
oidc-client-ts.js:48 [UserManagerEvents] load: access token present, remaining duration: 60
oidc-client-ts.js:48 [UserManagerEvents] load: registering expiring timer, raising in 30 seconds
oidc-client-ts.js:48 [Timer('Access token expiring')] init: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] init: skipping since already initialized for expiration at 1660524493
oidc-client-ts.js:48 [UserManagerEvents] load: registering expired timer, raising in 61 seconds
oidc-client-ts.js:48 [Timer('Access token expired')] init: begin
oidc-client-ts.js:48 [Timer('Access token expired')] init: skipping since already initialized for expiration at 1660524524
ParentSize.js:69 [Violation] 'requestAnimationFrame' handler took 119ms
[Violation] Forced reflow while executing JavaScript took 31ms
oidc-client-ts.js:48 [Timer('Access token expiring')] timer completes in 25
oidc-client-ts.js:48 [Timer('Access token expired')] timer completes in 56
oidc-client-ts.js:48 [Timer('Access token expiring')] timer completes in 20
oidc-client-ts.js:48 [Timer('Access token expired')] timer completes in 51
oidc-client-ts.js:48 [Timer('Access token expiring')] timer completes in 15
oidc-client-ts.js:48 [Timer('Access token expired')] timer completes in 46

(note the timer at the end proceeding as normal)

Refreshed page:

oidc-client-ts.js:48 [UserManager] startSilentRenew: begin
oidc-client-ts.js:48 [SilentRenewService] start: begin
oidc-client-ts.js:48 [UserManager] getUser: begin
oidc-client-ts.js:48 [UserManager] _loadUser: begin
oidc-client-ts.js:48 [WebStorageStateStore] get('user:http://localhost:8180/realms/xxx'): begin
oidc-client-ts.js:48 [UserManager] startSilentRenew: begin
oidc-client-ts.js:48 [SilentRenewService] start: begin
oidc-client-ts.js:48 [UserManager] getUser: begin
oidc-client-ts.js:48 [UserManager] _loadUser: begin
oidc-client-ts.js:48 [WebStorageStateStore] get('user:http://localhost:8180/realms/xxx'): begin
oidc-client-ts.js:48 [UserManager] getUser: begin
oidc-client-ts.js:48 [UserManager] _loadUser: begin
oidc-client-ts.js:48 [WebStorageStateStore] get('user:http://localhost:8180/realms/xxx'): begin
oidc-client-ts.js:48 [UserManager] _loadUser: user storageString loaded
oidc-client-ts.js:48 [User.fromStorageString] begin
oidc-client-ts.js:48 [UserManager] _loadUser: user storageString loaded
oidc-client-ts.js:48 [User.fromStorageString] begin
oidc-client-ts.js:48 [UserManager] _loadUser: user storageString loaded
oidc-client-ts.js:48 [User.fromStorageString] begin
oidc-client-ts.js:53 [UserManager] getUser: user loaded
oidc-client-ts.js:48 [UserManagerEvents] load: begin
oidc-client-ts.js:48 [UserManagerEvents] load: access token present, remaining duration: 31
oidc-client-ts.js:48 [UserManagerEvents] load: registering expiring timer, raising in 1 seconds
oidc-client-ts.js:48 [Timer('Access token expiring')] init: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] init: using duration 1
oidc-client-ts.js:48 [UserManagerEvents] load: registering expired timer, raising in 32 seconds
oidc-client-ts.js:48 [Timer('Access token expired')] init: begin
oidc-client-ts.js:48 [Timer('Access token expired')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expired')] init: using duration 32
oidc-client-ts.js:53 [UserManager] getUser: user loaded
oidc-client-ts.js:48 [UserManagerEvents] load: begin
oidc-client-ts.js:48 [UserManagerEvents] load: access token present, remaining duration: 31
oidc-client-ts.js:48 [UserManagerEvents] load: registering expiring timer, raising in 1 seconds
oidc-client-ts.js:48 [Timer('Access token expiring')] init: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] init: using duration 1
oidc-client-ts.js:48 [UserManagerEvents] load: registering expired timer, raising in 32 seconds
oidc-client-ts.js:48 [Timer('Access token expired')] init: begin
oidc-client-ts.js:48 [Timer('Access token expired')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expired')] init: using duration 32
oidc-client-ts.js:53 [UserManager] getUser: user loaded
oidc-client-ts.js:48 [UserManagerEvents] load: begin
oidc-client-ts.js:48 [UserManagerEvents] load: access token present, remaining duration: 31
oidc-client-ts.js:48 [UserManagerEvents] load: registering expiring timer, raising in 1 seconds
oidc-client-ts.js:48 [Timer('Access token expiring')] init: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] init: skipping since already initialized for expiration at 1660524585
oidc-client-ts.js:48 [UserManagerEvents] load: registering expired timer, raising in 32 seconds
oidc-client-ts.js:48 [Timer('Access token expired')] init: begin
oidc-client-ts.js:48 [Timer('Access token expired')] init: skipping since already initialized for expiration at 1660524616
oidc-client-ts.js:48 [Timer('Access token expiring')] timer completes in 0
oidc-client-ts.js:48 [Timer('Access token expiring')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] raise:
oidc-client-ts.js:48 [SilentRenewService] _tokenExpiring: begin
oidc-client-ts.js:48 [UserManager] signinSilent: begin
oidc-client-ts.js:48 [UserManager] _loadUser: begin
oidc-client-ts.js:48 [WebStorageStateStore] get('user:http://localhost:8180/realms/xxx'): begin
oidc-client-ts.js:48 [UserManager] _loadUser: user storageString loaded
oidc-client-ts.js:48 [User.fromStorageString] begin
oidc-client-ts.js:48 [UserManager] signinSilent: using refresh token
oidc-client-ts.js:48 [OidcClient] useRefreshToken: begin
oidc-client-ts.js:48 [TokenClient] exchangeRefreshToken: begin
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('token_endpoint'): begin
oidc-client-ts.js:48 [MetadataService] getMetadata: begin
oidc-client-ts.js:48 [MetadataService] getMetadata: getting metadata from http://localhost:8180/realms/xxx/.well-known/openid-configuration
oidc-client-ts.js:48 [JsonService] getJson: begin
oidc-client-ts.js:48 [JsonService] getJson: url: http://localhost:8180/realms/xxx/.well-known/openid-configuration
oidc-client-ts.js:48 [Timer('Access token expiring')] timer completes in 0
oidc-client-ts.js:48 [Timer('Access token expiring')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] raise:
oidc-client-ts.js:48 [SilentRenewService] _tokenExpiring: begin
oidc-client-ts.js:48 [UserManager] signinSilent: begin
oidc-client-ts.js:48 [UserManager] _loadUser: begin
oidc-client-ts.js:48 [WebStorageStateStore] get('user:http://localhost:8180/realms/xxx'): begin
oidc-client-ts.js:48 [UserManager] _loadUser: user storageString loaded
oidc-client-ts.js:48 [User.fromStorageString] begin
oidc-client-ts.js:48 [UserManager] signinSilent: using refresh token
oidc-client-ts.js:48 [OidcClient] useRefreshToken: begin
oidc-client-ts.js:48 [TokenClient] exchangeRefreshToken: begin
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('token_endpoint'): begin
oidc-client-ts.js:48 [MetadataService] getMetadata: begin
oidc-client-ts.js:48 [MetadataService] getMetadata: getting metadata from http://localhost:8180/realms/xxx/.well-known/openid-configuration
oidc-client-ts.js:48 [JsonService] getJson: begin
oidc-client-ts.js:48 [JsonService] getJson: url: http://localhost:8180/realms/xxx/.well-known/openid-configuration
2oidc-client-ts.js:48 [JsonService] getJson: HTTP response received, status 200
oidc-client-ts.js:48 [MetadataService] getMetadata: merging remote JSON with seed metadata
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('token_endpoint'): resolved
oidc-client-ts.js:48 [TokenClient] exchangeRefreshToken: got token endpoint
oidc-client-ts.js:48 [JsonService] postForm: begin
oidc-client-ts.js:48 [JsonService] postForm: url: http://localhost:8180/realms/xxx/protocol/openid-connect/token
oidc-client-ts.js:48 [MetadataService] getMetadata: merging remote JSON with seed metadata
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('token_endpoint'): resolved
oidc-client-ts.js:48 [TokenClient] exchangeRefreshToken: got token endpoint
oidc-client-ts.js:48 [JsonService] postForm: begin
oidc-client-ts.js:48 [JsonService] postForm: url: http://localhost:8180/realms/xxx/protocol/openid-connect/token
2oidc-client-ts.js:48 [JsonService] postForm: HTTP response received, status 200
oidc-client-ts.js:48 [TokenClient] exchangeRefreshToken: got response
oidc-client-ts.js:48 [OidcClient] useRefreshToken: validating response SigninResponse {xxx}
oidc-client-ts.js:48 [ResponseValidator] validateRefreshResponse: begin
oidc-client-ts.js:48 [ResponseValidator] _validateIdTokenAttributes: begin
oidc-client-ts.js:48 [ResponseValidator] _validateIdTokenAttributes: decoding ID Token JWT
oidc-client-ts.js:48 [ResponseValidator] validateRefreshResponse: ID Token validated
oidc-client-ts.js:48 [ResponseValidator] _processClaims: begin
oidc-client-ts.js:48 [ResponseValidator] _processClaims: loading user info
oidc-client-ts.js:48 [UserInfoService] getClaims: begin
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('userinfo_endpoint'): begin
oidc-client-ts.js:48 [MetadataService] getMetadata: begin
oidc-client-ts.js:48 [MetadataService] getMetadata: using cached values
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('userinfo_endpoint'): resolved
oidc-client-ts.js:48 [UserInfoService] getClaims: got userinfo url http://localhost:8180/realms/xxx/protocol/openid-connect/userinfo
oidc-client-ts.js:48 [JsonService] getJson: begin
oidc-client-ts.js:48 [JsonService] getJson: token passed, setting Authorization header
oidc-client-ts.js:48 [JsonService] getJson: url: http://localhost:8180/realms/xxx/protocol/openid-connect/userinfo
oidc-client-ts.js:48 [TokenClient] exchangeRefreshToken: got response
oidc-client-ts.js:48 [OidcClient] useRefreshToken: validating response SigninResponse {xxx}
oidc-client-ts.js:48 [ResponseValidator] validateRefreshResponse: begin
oidc-client-ts.js:48 [ResponseValidator] _validateIdTokenAttributes: begin
oidc-client-ts.js:48 [ResponseValidator] _validateIdTokenAttributes: decoding ID Token JWT
oidc-client-ts.js:48 [ResponseValidator] validateRefreshResponse: ID Token validated
oidc-client-ts.js:48 [ResponseValidator] _processClaims: begin
oidc-client-ts.js:48 [ResponseValidator] _processClaims: loading user info
oidc-client-ts.js:48 [UserInfoService] getClaims: begin
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('userinfo_endpoint'): begin
oidc-client-ts.js:48 [MetadataService] getMetadata: begin
oidc-client-ts.js:48 [MetadataService] getMetadata: using cached values
oidc-client-ts.js:48 [MetadataService] _getMetadataProperty('userinfo_endpoint'): resolved
oidc-client-ts.js:48 [UserInfoService] getClaims: got userinfo url http://localhost:8180/realms/xxx/protocol/openid-connect/userinfo
oidc-client-ts.js:48 [JsonService] getJson: begin
oidc-client-ts.js:48 [JsonService] getJson: token passed, setting Authorization header
oidc-client-ts.js:48 [JsonService] getJson: url: http://localhost:8180/realms/xxx/protocol/openid-connect/userinfo
oidc-client-ts.js:48 [JsonService] getJson: HTTP response received, status 200
oidc-client-ts.js:48 [UserInfoService] getClaims: got claims {xxx}
oidc-client-ts.js:48 [ResponseValidator] _processClaims: user info claims received from user info endpoint
oidc-client-ts.js:48 [ResponseValidator] _processClaims: user info claims received, updated profile: {xxx}
oidc-client-ts.js:48 [ResponseValidator] validateRefreshResponse: claims processed
oidc-client-ts.js:48 [UserManager] storeUser: begin
oidc-client-ts.js:48 [UserManager] storeUser: storing user
oidc-client-ts.js:48 [User] toStorageString: begin
oidc-client-ts.js:48 [WebStorageStateStore] set('user:http://localhost:8180/realms/xxx'): begin
oidc-client-ts.js:48 [UserManagerEvents] load: begin
oidc-client-ts.js:48 [UserManagerEvents] load: access token present, remaining duration: 60
oidc-client-ts.js:48 [UserManagerEvents] load: registering expiring timer, raising in 30 seconds
oidc-client-ts.js:48 [Timer('Access token expiring')] init: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] init: using duration 30
oidc-client-ts.js:48 [UserManagerEvents] load: registering expired timer, raising in 61 seconds
oidc-client-ts.js:48 [Timer('Access token expired')] init: begin
oidc-client-ts.js:48 [Timer('Access token expired')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expired')] init: using duration 61
oidc-client-ts.js:48 [Event('User loaded')] raise: User {xxx}
oidc-client-ts.js:48 [SilentRenewService] _tokenExpiring: silent token renewal successful
scheduler.development.js:147 [Violation] 'message' handler took 168ms
oidc-client-ts.js:48 [JsonService] getJson: HTTP response received, status 200
ParentSize.js:69 [Violation] 'requestAnimationFrame' handler took 101ms
oidc-client-ts.js:48 [UserInfoService] getClaims: got claims {xxx}
oidc-client-ts.js:48 [ResponseValidator] _processClaims: user info claims received from user info endpoint
oidc-client-ts.js:48 [ResponseValidator] _processClaims: user info claims received, updated profile: {xxx}
oidc-client-ts.js:48 [ResponseValidator] validateRefreshResponse: claims processed
oidc-client-ts.js:48 [UserManager] storeUser: begin
oidc-client-ts.js:48 [UserManager] storeUser: storing user
oidc-client-ts.js:48 [User] toStorageString: begin
oidc-client-ts.js:48 [WebStorageStateStore] set('user:http://localhost:8180/realms/xxx'): begin
oidc-client-ts.js:48 [UserManagerEvents] load: begin
oidc-client-ts.js:48 [UserManagerEvents] load: access token present, remaining duration: 59
oidc-client-ts.js:48 [UserManagerEvents] load: registering expiring timer, raising in 29 seconds
oidc-client-ts.js:48 [Timer('Access token expiring')] init: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expiring')] init: using duration 29
oidc-client-ts.js:48 [UserManagerEvents] load: registering expired timer, raising in 60 seconds
oidc-client-ts.js:48 [Timer('Access token expired')] init: begin
oidc-client-ts.js:48 [Timer('Access token expired')] cancel: begin
oidc-client-ts.js:48 [Timer('Access token expired')] init: using duration 60
oidc-client-ts.js:48 [Event('User loaded')] raise: User {xxx}
oidc-client-ts.js:48 [SilentRenewService] _tokenExpiring: silent token renewal successful
oidc-client-ts.js:48 [Timer('Access token expiring')] timer completes in 25
oidc-client-ts.js:48 [Timer('Access token expired')] timer completes in 56
oidc-client-ts.js:48 [Timer('Access token expiring')] timer completes in 24
oidc-client-ts.js:48 [Timer('Access token expired')] timer completes in 55
oidc-client-ts.js:48 [Timer('Access token expiring')] timer completes in 20
oidc-client-ts.js:48 [Timer('Access token expired')] timer completes in 51
oidc-client-ts.js:48 [Timer('Access token expiring')] timer completes in 19
oidc-client-ts.js:48 [Timer('Access token expired')] timer completes in 50

(note duplicated timer at the end)

@weyert
Copy link

weyert commented Nov 16, 2022

Did you find a solution for this problem?

@pamapa pamapa added the question Further information is requested label Jan 18, 2023
@EduardDumitru
Copy link

I've also encountered a duplicate authentication issue. It transformed into a race condition where authentication was called in an infinite loop and my laptop would shut down into protection mode. The only thing that worked for me was to set "silent_redirect_uri" to an empty string (because it would take the same value from redirect_uri) or to block self-frame through CSP so silent redirect wouldn't activate but that was an extreme method found by mistake :)). The only problem is that the silent authentication doesn't work anymore since I don't have the silent redirect link.

@pamapa
Copy link
Member

pamapa commented Oct 14, 2024

This issue (question) staled some time ago, closing it for now.

@pamapa pamapa closed this as completed Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants