HttpBasicCredentialValidator Delegate
Delegate used to validate HTTP Basic credentials.
public delegate ValueTask<ClaimsPrincipal?> HttpBasicCredentialValidator(HttpContext httpContext, string username, string password)Parameters
httpContextHttpContext- The current HTTP context.
usernamestring- The username from the Authorization header. It may be empty and never contains a colon.
passwordstring- The password from the Authorization header. It may be empty and may contain colons.
Remarks
Credentials containing a control character (U+0000 to U+001F, or U+007F) are rejected before this delegate is called. Other Unicode characters are passed through unchanged, so treat both values as untrusted input and escape them before logging.