KestrunHostAuthnExtensions.AddBasicAuthentication method (1 of 2)
Adds Basic Authentication to the Kestrun host.
Use this for simple username/password authentication.
public static KestrunHost AddBasicAuthentication(this KestrunHost host, string scheme = "Basic",
string? displayName = "Basic Authentication",
Action<BasicAuthenticationOptions>? configure = null)
| parameter | description |
|---|---|
| host | The Kestrun host instance. |
| scheme | The authentication scheme name (e.g. “Basic”). |
| displayName | The display name for the authentication scheme. |
| configure | Optional configuration for BasicAuthenticationOptions. |
Return Value
returns the KestrunHost instance.
See Also
- class KestrunHost
- class BasicAuthenticationOptions
- class KestrunHostAuthnExtensions
- namespace Kestrun.Hosting
KestrunHostAuthnExtensions.AddBasicAuthentication method (2 of 2)
Adds Basic Authentication to the Kestrun host using the provided options object.
public static KestrunHost AddBasicAuthentication(this KestrunHost host, string scheme,
string? displayName, BasicAuthenticationOptions configure)
| parameter | description |
|---|---|
| host | The Kestrun host instance. |
| scheme | The authentication scheme name (e.g. “Basic”). |
| displayName | The display name for the authentication scheme. |
| configure | The BasicAuthenticationOptions object to configure the authentication. |
Return Value
The configured KestrunHost instance.
See Also
- class KestrunHost
- class BasicAuthenticationOptions
- class KestrunHostAuthnExtensions
- namespace Kestrun.Hosting