You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe. JsonWebToken has a virtual ReadPayloadValue which is called when parsing a string token into the claims collection. A user can create a derived class from JsonWebToken and override this method to provide custom logic in reading a claim from the reader. The signature has a parameter IDictionary<string, object> claims which exposes the internal claims collection which is not ideal because this doesn't allow us to change it in the future, if we desire.
Describe the solution you'd like
Replace the virtual method with delegate which will be called when reading the claim value. The delegate can be added to the TokenValidationParameters and is maybe easier to set than creating a custom token type. public delegate object ReadTokenPayloadValueDelegate(ref Utf8JsonReader reader, string claimName);
Need to run perf benchmarks.
Describe alternatives you've considered
Change the virtual method signature: private protected virtual void ReadPayloadValue(ref Utf8JsonReader reader, string claimName)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
JsonWebToken
has a virtualReadPayloadValue
which is called when parsing a string token into the claims collection. A user can create a derived class from JsonWebToken and override this method to provide custom logic in reading a claim from the reader. The signature has a parameterIDictionary<string, object> claims
which exposes the internal claims collection which is not ideal because this doesn't allow us to change it in the future, if we desire.azure-activedirectory-identitymodel-extensions-for-dotnet/src/Microsoft.IdentityModel.JsonWebTokens/Json/JsonWebToken.PayloadClaimSet.cs
Line 55 in c964f16
Describe the solution you'd like
Replace the virtual method with delegate which will be called when reading the claim value. The delegate can be added to the
TokenValidationParameters
and is maybe easier to set than creating a custom token type.public delegate object ReadTokenPayloadValueDelegate(ref Utf8JsonReader reader, string claimName);
Need to run perf benchmarks.
Describe alternatives you've considered
Change the virtual method signature:
private protected virtual void ReadPayloadValue(ref Utf8JsonReader reader, string claimName)
The text was updated successfully, but these errors were encountered: