Azure AD身份验证回复地址不匹配

时间:2016-04-28 22:40:16

标签: azure ssl azure-active-directory azure-virtual-machine adal

因此,我按照指南here在Azure VM上设置了多个SSL站点。

设置了我遇到此问题的网站,以便Azure VM端点在内部将端口443上的外部流量重定向到端口442。

现在,当我尝试针对Azure AD进行身份验证时,我得到了这个:

Error validating credentials. AADSTS50011: The reply address
'https://website.com:442' does not match the reply
address 'https://website.com' provided when
requesting Authorization code.

我无法弄清楚为什么端口被附加到身份验证请求中的回复网址。如果端口是443,则它不会将端口443附加到URL。

在Azure管理门户中,我将回复网址设置为https://website.com。我无法将回复网址设置为https://website.com:442,因为该网址对外部流量不可见。

如果有人对如何解决这个问题有任何见解,我将非常感激。

1 个答案:

答案 0 :(得分:0)

我明白了。当我在下面打电话时,我可以将uri设置为没有端口的URL。在我更新它之前,它正在为URL调用HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Path),其中包括本地端口。我已将其更改为以不同方式构建URL以进行调试和发布。

AuthenticationResult result = authContext.AcquireTokenByAuthorizationCode( code, uri, credential, graphResourceId )