1

因此,我创建了一个使用 Microsoft graph api 的 MVC 应用程序 .net 框架。它使用 Azure 重定向 uri 进行身份验证。我有http://localhost:####并且在本地运行良好。现在我在 IIS 中发布了应用程序,需要更改重定向 URI。Azure 只接受以 localhost 或 https 开头的内容。我在 IIS 中没有 SSL 证书来执行 https,所以我想让它与 http 一起使用。Singon url和redirect url都是http?

我试过 bit.ly 重定向到 http。我什至在 azure 中注册了新应用程序并提供了一个新的登录 url 并在 webconfig 上进行了更改。但现在它说您要查找的页面无法显示 http 动词的无效方法。

4

2 回答 2

1

是的。Azure AD对重定向 URL 有限制

如果您没有 SSL 证书,最好为 https 域创建自签名证书。

可以参考之前的一篇文章:Trust a self-signed cert from IIS

于 2019-08-15T02:05:03.523 回答
0

即使不是,您也可以将用于身份验证的 Azure 重定向 uri 设置为“https://yourdomain.com”。然后在您的应用程序中启动:

if (environment.production) {
      if (location.protocol === 'https:') {
        window.location.href = location.href.replace('https', 'http');
      }
    }

这适用于我的 Angular SPA 应用程序

于 2020-11-12T10:51:17.773 回答