Skip to content
Discussion options

You must be logged in to vote

The Claim type's Value property will always be a string, which is why the docs use string representation in .NET.

var claim = new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean);
Console.WriteLine(claim.Value + " (type: " + claim.ValueType + "");

You can use a check such as if (claim.ValueType == ClaimValueTypes.Boolean) // ... and then cast the Value to a .NET type if needed in your application code.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by maartenba
Comment options

You must be logged in to vote
1 reply
@maartenba
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants