javascript - Azure Active Directory API 中的错误重定向 URI

标签 javascript azure-active-directory azure-api-apps microsoft-identity-platform

在本地主机上使用 Azure LS1 API 运行登录它工作正常,但是在服务器上迁移脚本我收到以下错误:

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

我知道问题出在 Azure 门户中的应用程序设置上,我应该在其中使用服务器地址而不是 localhost:30662 更改重定向 URI,但问题出在这里:因为应用程序必须在内部服务器上运行像 192.168.1.xxx 这样的地址和 Azure 门户需要一个带有 https://认证的地址,如果与本地主机不同,我该如何管理它以不在本地服务器上安装 SSL 证书?有没有办法在没有 https://的情况下插入重定向 URI?

var msalConfig = {
    auth: {
        clientId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        authority: "https://login.microsoftonline.com/organizations"
        redirectURI: "http://192.168.1.xxx:30662"
    },
    cache: {
        cacheLocation: "localStorage",
        storeAuthStateInCookie: true
    }
};

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

最佳答案

在旧版体验中,支持使用http://schemes。在新体验中,重定向 URI 的格式已更改。它们需要与应用程序类型(网络或公共(public))相关联。此外,出于安全原因,不支持通配符和 http://方案(http://localhost 除外)。

如果必须使用http://schemes,可以返回使用App registrations(Legacy)。

enter image description here

关于javascript - Azure Active Directory API 中的错误重定向 URI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58322210/

相关文章:

azure - 如何为我的 Azure API 应用程序设计托管环境(开发、阶段、产品)?

javascript - 操纵对象,使其自己的属性填充对象本身内部的数组

azure - 无法连接到 Azure Active Directory 安全 Ldap

azure - 如何使用 Azure Pipelines 在 Azure AD 中注册 Web 应用程序?

azure - 如何结合azure AppServices API、移动和Web应用程序

jquery - CORS 预检问题

javascript - 未捕获的类型错误 : Cannot read property 'nodeName' of null

javascript - 使用 JavaScript 在计算器上退格

javascript - AngularJS如何将元素附加到特定元素

azure - 如何以编程方式将 Azure AD 用户添加到 Azure DevOps 组织