-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.Security.Claims.PrincipalExtensions.FindFirstValue should return nullable value #32264
Comments
Why do you believe it should be nullable? What claim are you using that has a null value? As claims are serialised as strings it's generally just string.empty |
@blowdart because it literally says so in XML doc: |
Ah got it. OK that makes sense @HaoK a quick one for you |
Thanks for contacting us. We're moving this issue to the |
nullable isn't enabled for identity yet, so this is true in more than just this method |
@HaoK I didn't found tracking issue for "enable nullability for Identity" |
#27389 is one of the meta work items, we have some nullable support but its not fully implemented everywhere yet |
Closing as this is tracked by #27389 |
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
It should be
public static string? FindFirstValue(this ClaimsPrincipal principal, string claimType);
The text was updated successfully, but these errors were encountered: