📜  解码令牌以获取声明值 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:46.391000             🧑  作者: Mango

代码示例2
var Token = "[encoded jwt]";  
 var handler = new JwtSecurityTokenHandler(); 
 var jwt = handler.ReadJwtToken(token);
 var Name = jwt.Claims.First(claim => claim.Type == "Name").Value;
 var User_Id = jwt.Claims.First(claim => claim.Type == "User_Id").Value;