Angular MSAL 库有 9 个问题

Angular 9 issues with MSAL library

我在 angular 9

中遇到 MSAL 库问题
No redirect callbacks have been set. Please call handleRedirectCallback() with the appropriate function

我的身份验证服务中确实有 handleRedirectCallback() class

 private authService: MsalService,
 this.authService.handleRedirectCallback((authError, response) => {
        //do stuff
        }

        //do stuff
      });

但这似乎不起作用。有什么想法吗?

由于您正在使用 angular,因此使用 msal-angular 库可能是个好主意。它在 angular 9 项目中对我有用,但我不得不手动将 package.json 中的 "msal" 库更新为“^1.3.0-beta.0”。

请查看此内容,您可以相应地修改您的代码。该线程来自 msal-angular,但如果您也使用 js 库,则可以做同样的事情。

https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/angular8-sample-app/src/app/app.component.ts

问题跟踪于(见最后一条评论) https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/1184