📅  最后修改于: 2022-03-11 14:48:59.655000             🧑  作者: Mango
var claims = new List
{
new Claim(JwtRegisteredClaimNames.Sub, user.UserName),
new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
new Claim(ClaimTypes.NameIdentifier, user.Id),
new Claim(ClaimTypes.Role,"The Role Of the logged in user, you can get from your DB")
};