【问题标题】:How to get the object for handleRedirectCallback with MSAL and angular如何使用 MSAL 和角度获取 handleRedirectCallback 的对象
【发布时间】:2022-01-05 01:08:21
【问题描述】:

我遇到了一个问题,即 setLoginDisplay 永远不会与 MSAl 和 Azure B2C 一起触发

this.msalBroadcastService.inProgress$
    .pipe(
      filter((status: InteractionStatus) => status === InteractionStatus.None)
    )
    .subscribe(() => {
      this.setLoginDisplay();
      this.checkAndSetActiveAccount();
      this.getClaims(this.authService.instance.getActiveAccount()?.idTokenClaims)
    });
  }

它表示交互仍在进行中。这很像时间问题,因为我可以返回该站点,它显示我已登录。

我读到我需要调用 handleRedirectCallback 并等待它完成,然后再进行下一步,但对于我来说,我无法弄清楚要针对哪个对象进行调用。

如何访问具有 handleRedirectCallback 方法的 MSAL 对象?

【问题讨论】:

    标签: angular msal


    【解决方案1】:

    我能够像这样将它注入到构造函数中。

      @Inject(MSAL_INSTANCE) private msalInstance: PublicClientApplication
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-03
      • 1970-01-01
      • 2020-09-22
      • 1970-01-01
      • 2023-03-10
      • 2021-09-05
      • 1970-01-01
      • 2020-09-03
      相关资源
      最近更新 更多