ShowPII in Startup.cs has no effect

Thord J 1 Reputation point
2022-09-01T14:25:32.613+00:00

Hi,

I have an ASP.NET application that authenticates via Azure Active Directory. It appears to have stopped working with an error as follows:

IDX20803: Unable to obtain configuration from: '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

From searching the web I have found adding Microsoft.IdentityModel.Logging.IdentityModelEventSource.ShowPII = true in Startup.cs as below should display the error details:

   public void Configuration(IAppBuilder app)  
   {  
               ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;  
               IdentityModelEventSource.ShowPII = true;   
               ConfigureAuth(app);  
   }  

This works locally but unfortunately not on the remote server where the error message above continues to show.
I do not know of another way to debug this issue without the error information.

Is there anything else that would determine whether the PII is shown?

Windows development | Internet Information Services
Developer technologies | ASP.NET | ASP.NET Core
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
    2022-09-01T15:42:34.96+00:00

    as its a configuration error, there probably is no PII data.


Your answer

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