Skip to content

Instantly share code, notes, and snippets.

@isdaviddong
Last active August 12, 2025 14:02
Show Gist options
  • Save isdaviddong/e9644dcb95967a04cf7d0457177b8a12 to your computer and use it in GitHub Desktop.
Save isdaviddong/e9644dcb95967a04cf7d0457177b8a12 to your computer and use it in GitHub Desktop.
getTokenClaims.cs
var JwtSecurityToken = new System.IdentityModel.Tokens.Jwt.JwtSecurityToken(token.id_token);
var email = "";
//如果有email
if (JwtSecurityToken.Claims.ToList().Find(c => c.Type == "email") != null)
email = JwtSecurityToken.Claims.First(c => c.Type == "email").Value;
@hommaydi53714-glitch
Copy link

Hshahbsbsh

@hommaydi53714-glitch
Copy link

Nnbzbsbz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment