Table of Contents

Class AuthenticationOptions

Namespace
Cuemon.AspNetCore.Authentication
Assembly
Cuemon.AspNetCore.Authentication.dll

Base options for all authentication middleware.

public abstract class AuthenticationOptions : AuthenticationSchemeOptions, IValidatableParameterObject, IParameterObject
Inheritance
AuthenticationOptions
Implements
Derived
Inherited Members

Constructors

AuthenticationOptions()

Initializes a new instance of the AuthenticationOptions class.

protected AuthenticationOptions()

Remarks

The following table shows the initial property values for an instance of AuthenticationOptions.

PropertyInitial Value
ResponseHandler() => new HttpResponseMessage(HttpStatusCode.Unauthorized) { Content = new StringContent(UnauthorizedMessage) };
RequireSecureConnectiontrue
UnauthorizedMessageThe request has not been applied because it lacks valid authentication credentials for the target resource.

Properties

RequireSecureConnection

Gets or sets a value indicating whether a HTTP connection is required to use secure sockets (that is, HTTPS).

public bool RequireSecureConnection { get; set; }

Property Value

bool

true if the HTTP connection is required to use secure sockets (that is, HTTPS); otherwise, false.

ResponseHandler

Gets or sets the function delegate that configures the unauthorized response in the form of a HttpResponseMessage.

public Func<HttpResponseMessage> ResponseHandler { get; set; }

Property Value

Func<HttpResponseMessage>

The function delegate that configures the unauthorized response in the form of a HttpResponseMessage.

UnauthorizedMessage

Gets or sets the message of an unauthorized request.

public string UnauthorizedMessage { get; set; }

Property Value

string

The message of an unauthorized request.

Methods

ValidateOptions()

Determines whether the public read-write properties of this instance are in a valid state.

public virtual void ValidateOptions()

Remarks

This method is expected to throw exceptions when one or more conditions fails to be in a valid state.

Exceptions

InvalidOperationException

UnauthorizedMessage cannot be null.

See Also