最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

asp.net - Azure AD token endpoint API call timing out when deployed to IIS - Stack Overflow

programmeradmin6浏览0评论

Tech Stack:

  • ASP.NET Web page application
  • .NET Framework 4.7
  • Transitioning from Ping Federate to Azure AD
  • Windows 2016 Server
  • Flow => OAuth 2.0 auth code grant

We have a PING Federate OpenId Connect solution working for single sign-on on the IIS server. When converting to Azure AD, the C# code works on the dev machine (localhost). But when deployed to IIS Server, the token request call times out after 2 minutes.

On the IIS, the authorization call works fine and returns the code successfully, but when the API call is made to get token, it times out.

  • Auth url = /{tenant}/oauth2/v2.0/authorize

  • Token url = /{tenant}/oauth2/v2.0/token

Code:

var client = new HttpClient();
var stringContent = new StringContent(this.ToString(), Encoding.UTF8, "application/x-www-form-urlencoded");
                
var response = client.PostAsync(tokenUri, stringContent).Result;
response.EnsureSuccessStatusCode();
string responseBody = response.Content.ReadAsStringAsync().Result;

Not sure if it needs additional IIS settings? Or firewall port opening?

发布评论

评论列表(0)

  1. 暂无评论