Class DigestAuthorizationHeader
- Namespace
- Cuemon.AspNetCore.Authentication.Digest
- Assembly
- Cuemon.AspNetCore.Authentication.dll
Provides a representation of a HTTP Digest Access Authentication header. Implements the AuthorizationHeader
public class DigestAuthorizationHeader : AuthorizationHeader
- Inheritance
-
DigestAuthorizationHeader
- Inherited Members
Constructors
DigestAuthorizationHeader(string, string, string, string, string, string, string, string, string, string)
Initializes a new instance of the DigestAuthorizationHeader class.
public DigestAuthorizationHeader(string realm, string nonce, string opaque, string algorithm, string userName, string uri, string nc, string cNonce, string qop, string response)
Parameters
realmstringThe realm/credential scope that defines the remote resource.
noncestringThe unique server generated string.
opaquestringThe string of data specified by the server.
algorithmstringThe algorithm used to produce the digest and an unkeyed digest.
userNamestringThe username of the specified
realm.uristringThe effective request URI.
ncstringThe hexadecimal count of the number of requests the client has sent with the
noncevalue.cNoncestringThe unique client generated string.
qopstringThe "quality of protection" the client has applied to the message.
responsestringThe computed response which proves that the user knows a password.
Fields
Scheme
The authentication scheme of the DigestAuthorizationHeader.
public const string Scheme = "Digest"
Field Value
Properties
Algorithm
Gets the algorithm used to produce the digest and an unkeyed digest.
public string Algorithm { get; }
Property Value
- string
The algorithm used to produce the digest and an unkeyed digest.
CNonce
Gets the unique client generated string.
public string CNonce { get; }
Property Value
- string
The unique client generated string.
NC
Gets the hexadecimal count of the number of requests the client has sent with the Nonce value.
public string NC { get; }
Property Value
Nonce
Gets the unique server generated string.
public string Nonce { get; }
Property Value
- string
The unique server generated string.
Opaque
Gets the string of data specified by the server.
public string Opaque { get; }
Property Value
- string
The string of data specified by the server.
Qop
Gets the "quality of protection" the client has applied to the message.
public string Qop { get; }
Property Value
- string
The "quality of protection" the client has applied to the message.
Realm
Gets the realm/credential scope that defines the remote resource.
public string Realm { get; }
Property Value
- string
The realm/credential scope that defines the remote resource.
Response
Gets the computed response which proves that the user knows a password.
public string Response { get; }
Property Value
- string
The computed response which proves that the user knows a password.
Uri
Gets the effective request URI.
public string Uri { get; }
Property Value
- string
The effective request URI.
UserName
Gets the username of the specified Realm.
public string UserName { get; }
Property Value
Methods
Create(string)
Creates an instance of DigestAuthorizationHeader from the specified parameters.
public static DigestAuthorizationHeader Create(string authorizationHeader)
Parameters
authorizationHeaderstringThe raw HTTP authorization header.
Returns
- DigestAuthorizationHeader
An instance of DigestAuthorizationHeader.
Exceptions
- ArgumentNullException
authorizationHeadercannot be null.- ArgumentException
authorizationHeadercannot be empty or consist only of white-space characters.
ParseCore(IReadOnlyDictionary<string, string>)
The core parser that resolves an AuthorizationHeader from a set of credentials.
protected override AuthorizationHeader ParseCore(IReadOnlyDictionary<string, string> credentials)
Parameters
credentialsIReadOnlyDictionary<string, string>The credentials used in authentication.
Returns
- AuthorizationHeader
An AuthorizationHeader equivalent of
credentials.
ToString()
Returns a string that represents this instance.
public override string ToString()