Azure-activedirectory-identitymodel-extensions-for-dotnet: Odd instructions in an exception from the JWT handler

Created on 2 Mar 2018  路  9Comments  路  Source: AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet

System.ArgumentException: IDX12709: JWT is not well formed: '[PII is hidden by default. Set the 'ShowPII' flag in IdentityModelEventSource.cs to true to reveal it.]'.

<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.2.1" />
Customer reported P1

Most helpful comment

I think the message just needs to be a bit clearer. The message references a .cs file, making it look like you need to edit something rather than set a static property

All 9 comments

Same here. Did you find any clue ?

@brockallen @HolyNoodle as part of our GDPR effort, by default we hide any stack or variable info in our logs. You can enable additional detail by setting IdentityModelEventSource.ShowPII = true, when setting up logs.

That said, this looks like a format issue, we'll look into it.

I think the message just needs to be a bit clearer. The message references a .cs file, making it look like you need to edit something rather than set a static property

Valuable exception informations are hidden now. For example configuration errors are hard to understand, which is unrelated to PII.
Setting IdentityModelEventSource.ShowPII = true will lead to have this hardcoded for most developers.

A better approach would be to not expose PII within exception messages, or to obfuscate PII.
Or even better, to reduce the number of raised exceptions, remplaced by an error model.

@ycrumeyrolle @MatthewSteeples we talked about this and we think we will make these changes.
Write a log header the contains:
Date, Version, PII status indicating what API to use. Then for each exception just in a single phrase like: PII OFF.

How do I set the IdentityModelEventSource.ShowPII flag for a single instance of a JwtSecurityTokenHandler?

@brockallen you can't it's a process setting.

Is this fixed then?

It has been fixed to say "[PII is hidden]" I would prefer "[PII is hidden per GDPR]" or something like that.

Was this page helpful?
0 / 5 - 0 ratings