///验证securityToken public ClaimsPrincipal ValidateToken(string securityToken, TokenValidationParameters validationParameters, out SecurityToken validatedToken) { validatedToken = null; if (!SessionContainer.CheckRegistered(securityToken)) { return(null); } else { var identity = new ClaimsIdentity(JwtBearerDefaults.AuthenticationScheme); var principal = new ClaimsPrincipal(identity); return(principal); } }
} //顾名思义是验证token的最大bytes public bool CanReadToken(string securityToken) { return(SessionContainer.CheckRegistered(securityToken)); }