KestrunHostAuthExtensions.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", 
    Action<BasicAuthenticationOptions>? configure = null)
parameter description
host The Kestrun host instance.
scheme The authentication scheme name (e.g. “Basic”).
configure Optional configuration for BasicAuthenticationOptions.

Return Value

returns the KestrunHost instance.

See Also


KestrunHostAuthExtensions.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, 
    BasicAuthenticationOptions configure)
parameter description
host The Kestrun host instance.
scheme The authentication scheme name (e.g. “Basic”).
configure The BasicAuthenticationOptions object to configure the authentication.

Return Value

The configured KestrunHost instance.

See Also