question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] IDX10513 log message is dumping types instead of useful values

See original GitHub issue

Which 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:open
  • Created 10 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jmprieurcommented, Nov 10, 2022

Thanks @ohadschn for your investigation!

1reaction
ohadschncommented, Nov 10, 2022

@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:

var ki = new Microsoft.IdentityModel.Xml.KeyInfo();
Console.WriteLine(ki.ToString()); // prints "Microsoft.IdentityModel.Xml.KeyInfo"
Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found