Unable to obtain configuration from: PII is hidden

While developing my custom Jwt Token based authentication system, I was performing a smoke test to check if authorized API calls are being correctly authenticated and authorized or not. I used Postman to issue a GET request for an API end point. The request made it to server but an exception was thrown with the following message.

Unable to obtain configuration from: PII is hidden

There is not much information in the error message to tell what is wrong. But in the error message there is a link to https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/wiki/PII for more information. On the page it talks about GDPR telling you the framework does not display Personal Identifiable Information (PII) by default. You have to enable it to see the details.

It is very simple to enable the option to see the details. Goto ConfigureServices end point in your Startup class of your .Net Core 3.x implementation and add following line of code.

IdentityModelEventSource.ShowPII = true;

After I added the code and executed API call, the error message changed to following.

'IDX20803: Unable to obtain configuration from: 'https://www.iassetsmanager.com/.well-known/openid-configuration'.'

As I am implementing my custom authentication provider, I had to provide my OpenIdConnect configuration discovery end point. There is just word of caution when enabling PII option. Do not leave it turned on in production environment. You could expose more details than you intend to.

comments powered by Disqus

Search

Social

Weather

4.3 °C / 39.8 °F

weather conditions Clear

Monthly Posts

Blog Tags