No state in response after callback in oidc-client-js

Mike Anderson picture Mike Anderson · Mar 11, 2018 · Viewed 9.1k times · Source

I think this is an error related to angular 5.2.8 & 6 . With angular 5.2.7 work fine. I create a ng5 branch and update angular to latest 5.2.8 and the error com in! anybody can direct me to an angular 5.2.8 and later sample with oidc-client-js ?

Answer

Mike Anderson picture Mike Anderson · Mar 12, 2018

It is caused by URI encoding of state in the window.location.hash. For me this fix the issue:

if (window.location.hash) {
window.location.hash = decodeURIComponent(window.location.hash);
// authorizedCallback returns wrong result when hash is URI encoded
this.oidcSecurityService.authorizedCallback();
} else {
this.oidcSecurityService.authorize();
}