Table of Contents

Class DigestAuthenticationOptions

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

Configuration options for DigestAuthenticationMiddleware. This class cannot be inherited.

public sealed class DigestAuthenticationOptions : AuthenticationOptions, IValidatableParameterObject, IParameterObject
Inheritance
AuthenticationSchemeOptions
DigestAuthenticationOptions
Implements
Inherited Members
AuthenticationSchemeOptions.Validate()
AuthenticationSchemeOptions.Validate(String)
AuthenticationSchemeOptions.ClaimsIssuer
AuthenticationSchemeOptions.Events
AuthenticationSchemeOptions.EventsType
AuthenticationSchemeOptions.ForwardDefault
AuthenticationSchemeOptions.ForwardAuthenticate
AuthenticationSchemeOptions.ForwardChallenge
AuthenticationSchemeOptions.ForwardForbid
AuthenticationSchemeOptions.ForwardSignIn
AuthenticationSchemeOptions.ForwardSignOut
AuthenticationSchemeOptions.ForwardDefaultSelector
AuthenticationSchemeOptions.TimeProvider

Constructors

DigestAuthenticationOptions()

Initializes a new instance of the DigestAuthenticationOptions class.

public DigestAuthenticationOptions()

Remarks

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

PropertyInitial Value
AlgorithmSha256
Authenticatornull
NonceGeneratorA default implementation of a nonce generator.
OpaqueGeneratorA default implementation of an opaque generator.
NonceExpiredParserA default implementation of a nonce expiry parser.
NonceSecretA default secret to get you started without overwhelming configuration. Do change when moving outside a development environment.
RealmAuthenticationServer
UseServerSideHa1Storagefalse

Properties

Algorithm

Gets or sets the algorithm of the HTTP Digest Access Authentication. Default is Sha256.

public UnkeyedCryptoAlgorithm Algorithm { get; set; }

Property Value

UnkeyedCryptoAlgorithm

The algorithm of the HTTP Digest Access Authentication.

Remarks

Allowed values are: Md5, Sha256 and Sha512.

Authenticator

Gets or sets the function delegate that will perform the authentication from the specified username.

public DigestAuthenticator Authenticator { get; set; }

Property Value

DigestAuthenticator

The function delegate that will perform the authentication.

NonceExpiredParser

Gets or sets the function delegate for parsing nonce string values for expiration.

public Func<string, TimeSpan, bool> NonceExpiredParser { get; set; }

Property Value

Func<String, TimeSpan, Boolean>

The function delegate for parsing nonce string values for expiration.

NonceGenerator

Gets or sets the function delegate for generating nonce string values.

public Func<DateTime, string, byte[], string> NonceGenerator { get; set; }

Property Value

Func<DateTime, String, Byte[], String>

The function delegate for generating nonce string values.

NonceSecret

Gets or sets the function delegate for retrieving the cryptographic secret used in nonce string values.

public Func<byte[]> NonceSecret { get; set; }

Property Value

Func<Byte[]>

The function delegate for retrieving the cryptographic secret used in nonce string values.

OpaqueGenerator

Gets or sets the function delegate for generating opaque string values.

public Func<string> OpaqueGenerator { get; set; }

Property Value

Func<String>

The function delegate for generating opaque string values.

Realm

Gets the realm that defines the protection space.

public string Realm { get; set; }

Property Value

String

The realm that defines the protection space.

UseServerSideHa1Storage

Gets or sets a value indicating whether the server should bypass the calculation of HA1 password representation.

public bool UseServerSideHa1Storage { get; set; }

Property Value

Boolean

true if the server should bypass the calculation of HA1 password representation; otherwise, false.

Remarks

When enabled, the server reads the HA1 value directly from a secured storage.

Methods

ValidateOptions()

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

public override void ValidateOptions()

Remarks

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

Exceptions

InvalidOperationException

Authenticator cannot be null - or - NonceExpiredParser cannot be null - or - NonceGenerator cannot be null - or - NonceSecret cannot be null - or - OpaqueGenerator cannot be null - or - Realm cannot be null, empty or consist only of white-space characters.

See Also