[Bug] IDX10513 log message is dumping types instead of useful values
See original GitHub issueWhich version of Microsoft.IdentityModel are you using?
Latest from dev
branch
Where is the issue?
- M.IM.Logging
Expected behavior IDX10513 contains useful information of the actual key and token.
Actual behavior
IDX10513: Signature validation failed. Unable to match key: KeyInfo: 'Microsoft.IdentityModel.Xml.KeyInfo'. Exceptions caught: ''. token: 'Microsoft.IdentityModel.Tokens.Saml2.Saml2SecurityToken
Possible solution
Ideally override ToString
on the classes (and their subclasses if applicable):
Microsoft.IdentityModel.Xml.KeyInfo
System.IdentityModel.Tokens.SecurityToken
If that is somehow an issue, use some utility method to create a meaningful string when passed here: https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/59d1307a260829c0f8609a183a962aceaeffba89/src/Microsoft.IdentityModel.Tokens.Saml/Saml2/Saml2SecurityTokenHandler.cs#L470
Additional context / logs / screenshots / links to code
Add any other context about the problem here, such as logs and screenshots or links to code.
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Thanks @ohadschn for your investigation!
@jmprieur sorry I should have been explicit about it - yes, PII logging it is enabled. If it weren’t, the
IDX
message above would have included the text'[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'
The problem is the classes themselves don’t override
ToString()
. This can be easily verified, for example: