IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

No matching state found in storage

Open raigol opened this issue 9 years ago • 4 comments

Angular2 and IdentityServer4 I get: No matching state found in storage.

the same code works perfectly in development when running from Angular 2 cli ng serve localhost:4200

but when I do ng build --prod

and deploy to server I start getting "No matching state found in storage". I have checked that alls URLs are correct (authority, redirect_uri, post_logout_redirect_uri). What might cause this error?

the callback page is auth.html

Oidc.Log.logger = console; new Oidc.UserManager().signinRedirectCallback().then(function (user) { if (user == null) { document.getElementById("waiting").style.display = "none"; document.getElementById("error").innerText = "No sign-in request pending."; } else { window.location = "/"; } }) .catch(function (er) { document.getElementById("waiting").style.display = "none"; document.getElementById("error").innerText = er.message; });

auth.service has exact code from https://github.com/jmurphzyo/Angular2OidcClient/blob/master/src/app/shared/services/auth.service.ts

the Log from Chrome Developer Console

UserManager.getUser oidc-client.js:8265 _loadUser oidc-client.js:8265 WebStorageStateStore.get user:undefined:undefined oidc-client.js:8265 UserManager.signinRedirectCallback oidc-client.js:8265 RedirectNavigator.url oidc-client.js:8265 _signinEnd oidc-client.js:8265 OidcClient.processSigninResponse oidc-client.js:8265 UrlUtility.parseUrlFragment oidc-client.js:8265 WebStorageStateStore.remove 94ab8104dbf541aa8169559f329c97d7 oidc-client.js:8265 no user storageString oidc-client.js:8285 No matching state found in storage error @ oidc-client.js:8285

raigol avatar Mar 06 '17 17:03 raigol

This sounds more like an issue that should be opened on the oidc-client-js repo. Also, check there, as I have a feeling you're doing server-side rendering of your angular code, right?

brockallen avatar Mar 06 '17 17:03 brockallen

OK. I will open issue in oidc-client-js repo and closing here.

there is no server side rendering. I am following the example from https://github.com/jmurphzyo/Angular2OidcClient

code for auth.html is same as here
https://github.com/jmurphzyo/Angular2OidcClient/blob/master/src/auth.html

raigol avatar Mar 06 '17 19:03 raigol

opened new question in https://github.com/IdentityModel/oidc-client-js/issues/277

raigol avatar Mar 06 '17 19:03 raigol

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 15 '20 00:01 lock[bot]