session_state is lost on silent refresh token renewal
See original GitHub issueI am trying to use the silent refresh feature with session state management, but run into the following issue:
I have very short access token lifetime (5min). When oidc-client-ts (successfully, I might add) refreshes the access token using the refresh token, it seems to clear the session_state
field of User. This leads to session management not working when I reload the page, as now session_state
is null.
Steps to reproduce:
- Set up a client with
monitorSession: true
, short access token lifetimes and refresh tokens - Log in without any previous state
- Observe that the session mgmt iframe is loaded (via the debug log for example)
- Wait for silent refresh token renewal
- Reload the page
- Observe that no login attempt is made (since there is still a valid access token in sessionStorage)
- Observe that the session mgmt iframe is not loaded (since session_state is now null)
- This can also be verified by checking the content of sessionStorage
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Silent renew access_token via refresh_token in asp.net core ...
In you startup class, in the the Configure method add the following line that will renew an access token when it is near...
Read more >Token refresh problems / after session ends not redirected to ...
lua-resty-openidc triggers a silent authentication if the token is close to expiration and opts.refresh_session_interval is set.
Read more >Why is authentication lost after refreshing my single page ...
A workaround for this is to use Refresh Token Rotation and set the cacheLocation to “localstorage” when initializing the Auth0 client. Note: ...
Read more >Silent Refresh - Refreshing Access Tokens when using the ...
This means that if their access token expires, they should still be around to authorize another to be issued. We're not expecting the...
Read more >Migrate to Google Identity Services | Authorization
Your web app must be updated to detect an expired access token and request a new one. See the Token handling section below...
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
PS: I will release this week a new version
Thanks a bunch, I will try this as soon as I can.
Although I first have to check how I can do that easily from master without waiting for a new release 😃