Sudden Microsoft Identity error IDX20803

Alex D 16 Reputation points
2022-12-07T12:46:50.753+00:00

Hello.

All of a sudden I am no longer able to log into my ASP.NET web api on localhost.

I've been getting this error:

    System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'https://login.windows.net/578XXXXXX/v2.0/.well-known/openid-configuration'.  
     ---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'https://login.windows.net/578XXXXXX/v2.0/.well-known/openid-configuration'.  
     ---> System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 60 seconds elapsing.  
     ---> System.TimeoutException: A task was canceled.  
     ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.  
       at ........  

My configuration is correct:

  "AzureAd": {  
    "Instance": "https://login.windows.net",  
    "ClientId": "2103XXXXXXX",  
    "TenantId": "57XXXXXXX",  
    "Audience": "api://21XXXXX"  
  },  

My code in Startup:

    builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)  
       .AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("AzureAd"));  

All this worked perfectly fine until today.

There are no problems in production. The same code works perfectly in the deployed Azure App.

Any ideas why I'm getting this time out issue? Could it be a network issue on my end?

Microsoft Security | Microsoft Entra | Microsoft Entra ID

6 answers

Sort by: Newest
  1. Marilee Turscak-MSFT 37,411 Reputation points Microsoft Employee Moderator
    2022-12-09T22:45:33.087+00:00

    Hi @Alex D ,

    Thanks for your post and sorry to hear that you are facing this issue! I understand that you are seeing the following error:

    IDX20803: Unable to obtain configuration from: 'https://login.windows.net/578XXXXXX/v2.0/.well-known/openid-configuration'

    If this has happened suddenly with no changes to your network, this might be related to a recent change in Azure that requires apps to use TLS 1.2. If you are still using deprecated TLS protocols and have not updated to TLS 1.2 and .NET framework 4.7 or later, you may face this error.

    Otherwise if you have already updated the TLS version, this is normally a network error that is caused by the app being unable to connect to the Azure AD metadata endpoint. This occurs if something is blocking the connection (such as a firewall), the connection is not working for other reasons, or there is an outage (though I checked and did not find an outage report).

    If you are using a proxy server or firewall, you also need to make sure that the URLs on this page are safelisted.

    -

    If the information helped you, please Accept the answer. This will help us and other community members as well.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.