当请求使用msal-angular的访问令牌时,出现以下错误并增加了loadFrameTimeout时间,但仍然无法获取令牌
ngOnInit() {
console.log("inicia");
this.getUSerProfile();
this.subscription = this.broadcastService.subscribe("msal:acquireTokenSuccess", (payload) => {
console.log("acquire token success " + JSON.stringify(payload));
});
//will work for acquireTokenSilent and acquireTokenPopup
this.subscription = this.broadcastService.subscribe("msal:acquireTokenFailure", (payload) => {
console.log("acquire token failure " + JSON.stringify(payload))
//if (payload.errorCode == "consent_required" || payload.errorCode == "interaction_required" || payload.errorCode == "login_required") {
if (payload.errorDesc.indexOf("consent_required") !== -1 || payload.errorDesc.indexOf("interaction_required") != -1 ) {
this.authService.acquireTokenPopup(["XXXXXX-cdd8-4c6a-b0c5-XXXXXXXX/user_api"]).then((token) => {
this.getUSerProfile();
}, (error) => {
});
}
});
}