MSAL.js 2.0注册用户流程

时间:2020-06-22 15:47:36

标签: azure-ad-b2c msal.js

由于MSAL.js v1.x依赖于第三方Cookie,因此我想将SPA迁移到MSAL.js 2.0。

This migration document概述了如何实现这一目标。

问题是,当我使用与注册并登录用户流相同的权限时,它不起作用。该权限适用于MSAL.js。

是否存在有关如何通过“注册并登录”用户流程使用MSAL.js 2.0的示例或准则?


这是我得到的错误:

enter image description here


基本上我想实现与

相同的功能

https://github.com/Azure-Samples/active-directory-b2c-javascript-msal-singlepageapp

但使用Msal.js v2.0

1 个答案:

答案 0 :(得分:0)

我收到此错误,因为我的knownAuthorities属性错误。它不应该包含https://

示例配置

auth: {
    clientId: "YOUR_CLIENT_ID",
    authority: "https://<tenant>.b2clogin.com/<tenant>.onmicrosoft.com/<policy>",
    knownAuthorities: ["<tenant>.b2clogin.com"],
    redirectUri: "",
    postLogoutRedirectUri: ""
  }