setupAutomaticSilentRefresh() works but is called too frequently
See original GitHub issueHi,
We’re using version 2.1.3 and are using silent refresh. It is configured like this:
this.oauthService.silentRefreshRedirectUri = window.location.origin + "/" + relativeAppPath + "silent-renew.html";
this.oauthService.setupAutomaticSilentRefresh();
this.oauthService.timeoutFactor = 0.9;
Our token currently has a lifetime of 10 hours. I know, far far too long and we’ll be reducing it to a more reasonable and secure timeframe but that’s what it is for now.
I have checked the expires_at field in session storage and the ticks it is writing converts to 10 hours relative.
My question is about the automatic silent refresh. It’s happening every 4-5 minutes which is far too frequent given the configuration outlined above. Any ideas why this might be?
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Silent Refresh - angular-oauth2-oidc
This is a well-known solution that compensates the fact that implicit flow does not allow for issuing a refresh token. It uses a...
Read more >angular-oauth2-oidc : Enabling silent refresh results in ...
I have used this.oauthService.setupAutomaticSilentRefresh() in my code to enable the silent refresh. Please help me how can we stop so many ...
Read more >angular-oauth2-oidc
I have to two independent frontends (A and B). Both frontends obtains their tokens via authCode. In one use-case the frontends should work...
Read more >SPA Client (Authz Code with PKCE) - openid-connect- ...
In contrast to Lab 2 and Lab 3 this time the client will be using the ... how to build an OAuth 2.0/OIDC...
Read more >Silent Refresh - Refreshing Access Tokens when using the ...
Understanding silent refresh and how to implement it using ... but there is another mechanism we can use, commonly called “silent refresh”.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We are experiencing the same issue where we want to refresh only on
access_token
expiration, but only theid_token
timer is set. Is there a plan to merge @harmpauw’s PR anytime soon?@jeroenheijmans the issue still remains the way @davdev82 described. If the id token has a shorter lifespan than the access token and you configure setupAutomaticSilentRefresh to only listen to access token expiration, the access token will never be refreshed. I created a pull request that always fires the token_expires event for both token. setupAutomaticSilentRefresh() then filters the token_expires event for the correct token type.