Clearer documentation: userInfo - email_verified #490
-
|
On the JWT Claim Types page, the documentation has proved to be misleading. The text states:
As the table doesn't include a type column, this can imply that the return should be a string. Of course, the OIDC specification should always be the source of truth, but a simple change can make a lot of difference.
Cheers, Roy |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
The var claim = new Claim(JwtClaimTypes.EmailVerified, "true", ClaimValueTypes.Boolean);
Console.WriteLine(claim.Value + " (type: " + claim.ValueType + "");
You can use a check such as |
Beta Was this translation helpful? Give feedback.
-
|
This was missed on our side: ClaimValueTypes.Boolean
Thanks for your help…
|
Beta Was this translation helpful? Give feedback.

The
Claimtype'sValueproperty will always be a string, which is why the docs use string representation in .NET.You can use a check such as
if (claim.ValueType == ClaimValueTypes.Boolean) // ...and then cast theValueto a .NET type if needed in your application code.