2017-11-10 4 views
0

ASP.NET Core 2에서 웹 API를 작성했으며 Azure AD로 보안됩니다. 요청 devde 환경에서 잘 작동합니다. 그러나 IIS에 API를 게시하고 Authorization 헤더를 요청할 때 요청하면 다음 오류가 표시됩니다.Azure AD에서 IDX10803 및 IDX10804 오류

fail: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[3] 
    Exception occurred while processing message. 

System.InvalidOperationException: IDX10803: Unable to obtain configuration from: 'https://login.microsoftonline.com/xxxx/.well-known/openid-configuration'. ---> System.IO.IOException: IDX10804: Unable to retrieve document from: 'https://login.microsoftonline.com/xxxx/.well-known/openid-configuration'. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: A connection with the server could not be established 

무엇이 잘못 되었나요? 브라우저에서 URL을 성공적으로 탐색 할 수 있습니다.

+0

이미 확인 했습니까 https://github.com/aspnet/Security/issues/1116 및 https://github.com/aspnet/Security/issues/1062 – Aravind

+0

예 인증서 문제와 관련이 있습니다. Azure AD이므로 모든 인증서가 유효해야합니다. – Mayank

+0

IIS apppool을 실행중인 계정을 확인하십시오. 해당 계정이 인증서를 신뢰할 수 없다는 것을 나타낼 수 있습니다. – rawel

답변

0

나는 그것을 알아 냈다. 인터넷에 액세스하기위한 프록시 설정 때문이었습니다. ASP.NET Core는 web.config의 system.net 영역에서 프록시 설정을 선택하지 않기 때문에 이상적인 솔루션은 프록시로 작동 할 중간 도구를 만드는 것입니다.

시간이 부족합니다. 그래서 새로운 사용자를 생성하고 새 사용자와 함께 서버에 로그온하고 Internet Explorer 옵션에서 프록시 설정을 구성했습니다. 그런 다음 IIS에서 App Pool을 해당 사용자의 ID로 실행하도록 구성했습니다. 문제 해결됨!