Randomly occurring Unable to retrieve document from: '[PII is hidden]'

Waqas Zaheer 21 Reputation points
2022-07-31T10:06:53.3+00:00

I came along with so many questions and answers but could not understand or find solution as my case is bit different. I am using Azure with openIdconnect for Active directory authentication (ASP.Net framework 4.6.1)

it has been years it was working fine but a day before yesterday this error occurred for only about 1 hour. error was occurring when trying to do AD authentication.

Exception Message: IDX20803: Unable to obtain configuration from: '[PII is hidden]'.
Inner Exception: System.IO.IOException: IDX20804: Unable to retrieve document from: '[PII is hidden]'. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).

StackTrace: System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden]'. ---> System.IO.IOException: IDX20804: Unable to retrieve document from: '[PII is hidden]'. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).

during this local authentication and remaining whole application was working fine. After 1 hour this issue was automatically resolved. same happened yesterday. issue occurred for 1 hour and resolved automatically.

Other solution are suggesting to modify IdentityModelEventSource.ShowPII = true; But I dont think so it requires code modification.
Please guide what can be reason that this happens for only short time.
Note: this is happening on only one server all applications on other servers are working fine

Thanks in advance

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,254 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,465 questions
0 comments No comments
{count} votes

Accepted answer
  1. 2022-07-31T20:10:45.747+00:00

    Hello @Waqas Zaheer , usually this is being caused by a malformed Open IDC metadata document URL. IdentityModelEventSource.ShowPII is pretty useful for that purpose. Alternatively, you can Collect a network trace with Fiddler and find the mal formed call.

    Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.


0 additional answers

Sort by: Most helpful