.NET Core Web API fails to validate auth token when published to Azure

I have an Angular app that uses Okta to manage user logins and connects to an .NET Core Web API. The Angular app sends the Okta auth token along with all API requests. The API is meant to validate the auth token before processing the request and extract the uid.

I followed the directions on the Okta Dev website here:

On my dev machine, everything works perfectly. However, once the API is deployed to Azure, this line in the ValidateToken method fails every time:

var discoveryDocument = await configurationManager.GetConfigurationAsync(ct);

That line is throwing an IDX20803 error. The authorization server passed into the confiurationManager and the Azure server both share the same domain, so I don’t think there would be a firewall or proxy issue. Has anyone else had similar issues with the GetConfigurationAsync method, and if so, how did you solve it?

Hello,
Not sure if it could be related to,
Always get System.InvalidOperationException: IDX20803: Unable to obtain configuration from: Error.

A number of suggestions from here as well,
c# - "InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden]'" - Stack Overflow.

1 Like

Well, I thought that I had previously checked out that StackOverflow post, but I guess I missed one of the potential solutions. The thing that ended up working for me was this:

On the downside, the requests take considerably longer now, but at least they are working. Thanks!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.