Class DigestAuthenticationOptions
- Assembly
- Cuemon.AspNetCore.Authentication.dll
Configuration options for DigestAuthenticationMiddleware. This class cannot be inherited.
public sealed class DigestAuthenticationOptions : AuthenticationOptions, IValidatableParameterObject, IParameterObject
- Inheritance
-
AuthenticationSchemeOptionsDigestAuthenticationOptions
- Implements
- Inherited Members
-
AuthenticationSchemeOptions.Validate()AuthenticationSchemeOptions.Validate(String)AuthenticationSchemeOptions.ClaimsIssuerAuthenticationSchemeOptions.EventsAuthenticationSchemeOptions.EventsTypeAuthenticationSchemeOptions.ForwardDefaultAuthenticationSchemeOptions.ForwardAuthenticateAuthenticationSchemeOptions.ForwardChallengeAuthenticationSchemeOptions.ForwardForbidAuthenticationSchemeOptions.ForwardSignInAuthenticationSchemeOptions.ForwardSignOutAuthenticationSchemeOptions.ForwardDefaultSelectorAuthenticationSchemeOptions.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.
Property | Initial Value |
---|---|
Algorithm | Sha256 |
Authenticator | null |
NonceGenerator | A default implementation of a nonce generator. |
OpaqueGenerator | A default implementation of an opaque generator. |
NonceExpiredParser | A default implementation of a nonce expiry parser. |
NonceSecret | A default secret to get you started without overwhelming configuration. Do change when moving outside a development environment. |
Realm | AuthenticationServer |
UseServerSideHa1Storage | false |
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
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
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
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.