首页 > 解决方案 > Azure Active Directory API 中的错误重定向 URI

问题描述

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

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

我知道问题出在 Azure 门户中的应用程序设置上,我应该使用服务器地址而不是 localhost:30662 更改重定向 URI,但问题出在此处:因为应用程序必须在地址为 192.168 的内部服务器上运行.1.xxx 和 Azure 门户需要一个带有 https:// 认证的地址(如果与 localhost 不同),我该如何管理它以不在本地服务器上安装 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 不匹配:

标签: javascriptazure-active-directoryazure-api-appsmicrosoft-identity-platform

解决方案


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

如果您必须使用http:// schemes,您可以返回使用 App 注册(旧版)。

在此处输入图像描述


推荐阅读