我正在使用msal
对用户进行身份验证。
我的userAgentApplication
看起来像这样:
var userAgentApplication = new UserAgentApplication({
auth: {
clientId: config.appId,
authority: config.authority,
validateAuthority: false,
},
cache: {
cacheLocation: "localStorage",
storeAuthStateInCookie: true,
},
});
这是我的config.js
modules.exports = {
appId: "<my-App-id>",
authority:
"https://login.microsoftonline.com/<my-Tenant-id>/",
scopes: ["user.read", "calendars.read"],
};
我一直遇到这个错误,我不知道为什么会发生。
Request Id: 38b5b62e-0407-4520-8319-157b9c2e3e00
Correlation Id: 143c20c5-4cab-41be-aded-14daa783d022
Timestamp: 2020-04-06T07:21:35Z
Message: AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: 'xxxxxxxxxx'.
如果实例化auth.redirectUri
时未设置UserAgentApplication
,则msal
将使用当前页面的URL作为为每个请求设置的redirectUri
,并且用作redirectUri
的页面必须全部为在Azure门户中注册。您需要将auth.redirectUri
设置为在Azure门户中注册的URL,或者将应用程序中的所有页面注册为可能的重定向uri(可能不太理想)。