Navigate back to login (browser back button) and then login => No matching state found in storage
See original GitHub issueSame problem as the original library https://github.com/IdentityModel/oidc-client-js/issues/940.
The scenario is:
user lands on app page -> page checks user, if not logged in -> signinRedirect to Id server -> Id server redirects back to auth-callback -> auth-callback navigates to some page in app.
Now if user pressed back button which will take it back to the login (where the state (state which is sent to id server) wouldn’t be written to local storage which is why siginRedirectCallback throws this error.
https://github.com/IdentityModel/oidc-client-js/issues/940#issuecomment-532657529
Should oidc-client-ts
leave the state available for some time?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Navigate back to login (browser back button) and then login ...
If you navigate to id server login page by press back button and clicks on login again, we get the error No matching...
Read more >OIDC client issue in Edge - Stack Overflow
I'm getting below error only in edge and IE in private mode. OidcClient.readSigninResponseState: No matching state found in storage UserManager.
Read more >Impossible to log-in – Docker server time out of sync - bugs
Uncaught (in promise) Error: No matching state found in storage ... Hi, Our scenario is like this: If user presses browser back button...
Read more >Clicking back button after login to callback link throws invalid ...
After successful login, callback url gets called and redirects to http://localhost:3000/dashboard Now I click back button on my chrome ...
Read more >Back/forward cache - web.dev
Back /forward cache (or bfcache) is a browser optimization that enables instant back and forward navigation. It significantly improves the ...
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
I’m not sure if there’s much that should be done here. In my mind, navigating into the middle of an authentication flow is invalid and should generate an error. The spec doesn’t seem to have a strict prescription on how to treat this scenario, but it does suggesting associating an authentication session cookie with the
nonce
parameter provided by the client in order to prevent replay attacks. In case the auth server doesn’t implement this restriction (as in @pamapa’s screenshots), the UX I’d expect from the application side would be an error explaining that the sign in request is invalid with options to restart the sign in flow. We could make this simpler by providing a named error so that applications don’t need to parse error message strings.I assume that happen in may case.
The current
oidc-client-ts
implementation ex-changes the localStoragestate
against aprofile
, which makes it simple. I am afraid if we break that it will make things more complicated. Is onlyCognito
affected? Will usinghistory.replaceState
+ forward button bring you too back?@kherock Can you reproduce with your authentication service?