Wednesday, July 15, 2020

Claims Identity - Extract UPN from a claim (IIdentity)

A claim with the type IIdentity can contain multiple claims and quite often we may need to extract the value of a particular claim within. This is fairly simple like so:

var email = principal.FindFirst(ClaimTypes.Upn)?.Value;

Reference: https://docs.microsoft.com/en-us/azure/architecture/multitenant-identity/claims

No comments:

SSL Error - The connection for this site is not secure

 After cloning a git repo of dot net framework website and trying to run it all I could see was this error Turns out the fix was to simply e...