public ClaimsPrincipal GetPrincipalFromToken(string token, string signingKey) { return(_jwtTokenHandler.ValidateToken(token, new TokenValidationParameters { ValidateAudience = false, ValidateIssuer = false, ValidateIssuerSigningKey = true, IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(signingKey)), ValidateLifetime = false // we check expired tokens here })); }