javascript - AADSTS50011 : The reply URL specified in the request does not match the reply URLs configured for the application:

标签 javascript microsoft-graph-api azure-ad-msal msal.js

我正在使用 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'.

最佳答案

如果实例化 UserAgentApplication 时未设置 auth.redirectUrimsal 将使用当前页面的 url 作为 为每个请求设置的 >redirectUri 以及用作 redirectUri 的页面都必须在 Azure 门户中注册。您需要将 auth.redirectUri 设置为在 Azure 门户中注册的 url,或者将应用程序中的所有页面注册为可能的重定向 uri(可能不太可取)。

关于javascript - AADSTS50011 : The reply URL specified in the request does not match the reply URLs configured for the application:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61054921/

相关文章:

javascript - Web 服务器可以在响应请求之前以什么方式检查是否在现有页面上重定向 GET 请求?

javascript - 如何在 WebBrowser 控件中捕获 POST 的结果?

javascript - 用按钮 (Drupal) 替换页面中的 CSS(或页面元素)

office365 - findRooms API 限制为 100 个房间

javascript - 将 PHP cURL 转换为 JavaScript(连接到 WCF 服务)

php - Microsoft graph 无法读取 JSON 请求负载

c# - 通过 Microsoft.Graph 邀请用户会出现错误

azure - 用户关闭并重新打开浏览器后,需要使用 Azure AD B2C 重新进行身份验证

java - 如何使用 Java 中的 MSAL 从 Microsoft Outlook 发送电子邮件?

c# - 使用 MSAL 通过服务帐户获取 token