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?

Internet Information Services
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,236 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,307 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,816 questions
0 comments No comments
{count} votes

1 answer

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

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