Created
September 15, 2014 11:04
-
-
Save tugberkugurlu/70a42b426b68c760673d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ClaimsIdentityExtensions | |
{ | |
public static string GetUserEmail(this ClaimsIdentity identity) | |
{ | |
Claim emailClaim = identity.Claims.FirstOrDefault(claim => claim.Type == ClaimTypes.Email); | |
return emailClaim != null | |
? emailClaim.Value | |
: null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment