由于MSAL.js v1.x依赖于第三方Cookie,因此我想将SPA迁移到MSAL.js 2.0。
This migration document概述了如何实现这一目标。
问题是,当我使用与注册并登录用户流相同的权限时,它不起作用。该权限适用于MSAL.js。
是否存在有关如何通过“注册并登录”用户流程使用MSAL.js 2.0的示例或准则?
这是我得到的错误:
基本上我想实现与
相同的功能https://github.com/Azure-Samples/active-directory-b2c-javascript-msal-singlepageapp
但使用Msal.js v2.0
答案 0 :(得分:0)
我收到此错误,因为我的knownAuthorities
属性错误。它不应该包含https://
。
auth: {
clientId: "YOUR_CLIENT_ID",
authority: "https://<tenant>.b2clogin.com/<tenant>.onmicrosoft.com/<policy>",
knownAuthorities: ["<tenant>.b2clogin.com"],
redirectUri: "",
postLogoutRedirectUri: ""
}