azure-activedirectory-identitymodel-extensions-for-dotnet
azure-activedirectory-identitymodel-extensions-for-dotnet copied to clipboard
[Feature Request] Ability for JWT claims to be complex objects
Is your feature request related to a problem? Please describe. See details in related issue #2585.
When serializing claims, IdentityModel 6x used to serialize the whole object (using Newtonsoft). 7x+ calls ToString()
on the claim object instead.
Describe the solution you'd like
Ability to have JWT claims be of custom type which are serialized correctly. Related methods like TryGetPayloadValue<CustomClass>(name)
should also work.
Describe alternatives you've considered Pass claim as a JsonElement. See example in https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/2455#issuecomment-1911006805