JwtSecurityTokenHandler tokenHandler = new JwtSecurityTokenHandler();
JwtSecurityToken jwtToken = (JwtSecurityToken)tokenHandler.ReadToken(token);
byte[] key = Convert.FromBase64String(secret);
TokenValidationParameters parametrs = new TokenValidationParameters()
{
RequireExpirationTime = true,
ValidateIssuer = false,
ValidateAudience = false,
IssuerSigningKey = new SymmetricSecurityKey(key)
};
SecurityToken securityToken;
ClaimsPrincipal principal = tokenHandler.ValidateToken(token, parametrs, out securityToken);
Claim myClaim=new Claim(property, value);
ClaimsIdentity identity = new ClaimsIdentity();
identity.AddClaim(myClaim);
principal.AddIdentity(identity);