【发布时间】:2021-03-11 18:17:12
【问题描述】:
我正在尝试使用 @azure/msal-node 库在我的节点项目中创建一个 UserAgentApplication,但我收到一个错误 TypeError: Msal.UserAgentApplication不是构造函数。下面是我的详细代码和错误响应。
const Msal = require("@azure/msal-node");
const config = {
auth: {
clientId: "xxx-xxxx-xxxx",
authority:"https://login.microsoftonline.com/xxxx-xxxxx",
validateAuthority: true,
postLogoutRedirectUri: "https://localhost:3000",
redirectUri: "https://localhost:3000/app",
navigateToLoginRequestUrl: true,
},
};
const maslAuthorize = new Msal.UserAgentApplication(config);
module.exports = maslAuthorize;
错误响应:
const maslAuthorize = new Msal.UserAgentApplication(config); TypeError: Msal.UserAgentApplication 不是构造函数
【问题讨论】:
-
你不能在
@azure/msal-node上使用UserAgentApplication考虑使用PublicClientApplication -
怎么样?你的问题解决了吗?
标签: javascript node.js authentication azure-active-directory msal