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

时光怂恿深爱的人放手 提交于 2020-02-03 04:28:07

问题


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 ?


回答1:


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();
}



回答2:


If you are doing something custom like me and your issue has nothing to do with hash location, just ignore it:

  completeAuthentication(): Promise<void> {
    return this.manager.signinRedirectCallback().then(user => {
      this.user = user;
    }).catch((err) => {});
  }


来源:https://stackoverflow.com/questions/49220150/no-state-in-response-after-callback-in-oidc-client-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!