示例#1
0
 private bool ValidateToken(string token)
 {
     try
     {
         var handler     = new JwtSecurityTokenHandler();
         var validations = jwtAuthManager.GetTokenValidationParameters();
         //fetch claims from auth token if throw exception means not a valid token
         handler.ValidateToken(token, validations, out var tokenSecure);
         return(true);
     }
     catch
     {
         return(false);
     }
 }