BasicAuthenticationOptions class
Options for configuring Basic Authentication in Kestrun.
public class BasicAuthenticationOptions : AuthenticationSchemeOptions,
IAuthenticationCommonOptions, IOpenApiAuthenticationOptions
Public Members
| name | description |
|---|---|
| BasicAuthenticationOptions() | The default constructor. |
| AllowInsecureHttp { get; set; } | Gets or sets a value indicating whether to allow insecure HTTP connections. |
| Base64Encoded { get; set; } | Gets or sets a value indicating whether the credentials are Base64 encoded. |
| ClaimPolicyConfig { get; set; } | Gets or sets the claim policy configuration. |
| Description { get; set; } | |
| DisplayName { get; set; } | |
| DocumentationId { get; set; } | |
| GlobalScheme { get; set; } | |
| HeaderName { get; set; } | Gets or sets the name of the HTTP header used for authentication. |
| Host { get; set; } | |
| IssueClaims { get; set; } | After credentials are valid, this is called to add extra Claims. Parameters: HttpContext, username → IEnumerable of extra claims. |
| IssueClaimsCodeSettings { get; set; } | Settings for the claims issuing code, if using a script. |
| Logger { get; set; } | |
| Realm { get; set; } | Gets or sets the authentication realm used in the WWW-Authenticate header. |
| SeparatorRegex { get; set; } | Gets or sets the regular expression used to separate the username and password in the credentials. |
| SuppressWwwAuthenticate { get; set; } | Gets or sets a value indicating whether to suppress the WWW-Authenticate header in responses. |
| ValidateCodeSettings { get; set; } | Settings for the authentication code, if using a script. |
| ValidateCredentialsAsync { get; set; } | Delegate to validate user credentials. Parameters: HttpContext, username, password. Returns: Task<bool> indicating validity. |
| ApplyTo(…) | Helper to copy values from a user-supplied BasicAuthenticationOptions instance to the instance created by the framework inside AddBasic(). Reassigning the local variable (opts = source) would not work because only the local reference changes – the framework keeps the original instance. |
See Also
- interface IAuthenticationCommonOptions
- interface IOpenApiAuthenticationOptions
- namespace Kestrun.Authentication
- BasicAuthenticationOptions.cs