AADSTS50011:在请求中指定的回复URL与为应用程序配置的回复URL不匹配:

问题描述 投票:0回答:1

我正在使用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'.
javascript microsoft-graph msal msal.js
1个回答
0
投票

如果实例化auth.redirectUri时未设置UserAgentApplication,则msal将使用当前页面的URL作为为每个请求设置的redirectUri,并且用作redirectUri的页面必须全部为在Azure门户中注册。您需要将auth.redirectUri设置为在Azure门户中注册的URL,或者将应用程序中的所有页面注册为可能的重定向uri(可能不太理想)。

© www.soinside.com 2019 - 2024. All rights reserved.