-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
aspnetcore-token-authentication/Wd3w.TokenAuthentication/TokenAuthenticationHandler.cs
Lines 54 to 73 in 03c5b0f
var scheme = Options.Scheme; | |
if (authPair.Count != 2) | |
return Fail("invalid_format", $"Authorization must be formatted as '{scheme} <token>'"); | |
if (authPair[0] != Scheme.Name) | |
return Fail("invalid_scheme", $"Scheme must be {scheme}"); | |
if (authPair[1].Length != Options.TokenLength) | |
return Fail("invalid_token_length", $"Access Token`s length must be {Options.TokenLength}"); | |
var accessToken = authPair[1]; | |
try | |
{ | |
if (!await _authService.IsValidateAsync(accessToken)) | |
return Fail("invalid_token", $"{scheme} Token({accessToken}) is invalid"); | |
} | |
catch (AuthenticationFailException e) | |
{ | |
return AuthenticateResult.Fail(e); | |
} |
- How to validating string complexity for access token?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request