public bool IsValidToken(string token) { try { ClaimsPrincipal principal = TokenProvider.GetPrincipal(token); if (principal == null) { return(false); } else { return(true); } } catch (Exception) { throw; } }