Table of Contents

Class DigestFields

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

A collection of constants for DigestAuthorizationHeaderBuilder.

public static class DigestFields
Inheritance
DigestFields

Examples

The following example demonstrates how to use the field constants of DigestFields when building a Digest access authorization header.

using System;
using Cuemon.AspNetCore.Authentication.Digest;

namespace MyApp.Examples;

public static class DigestFieldsExample
{
    public static void Demonstrate()
    {
        var builder = new DigestAuthorizationHeaderBuilder(DigestCryptoAlgorithm.Sha256);
        builder.AddRealm("my-realm");
        builder.AddUserName("alice");
        builder.AddUri("/api/resource");
        builder.AddNc(1);
        builder.AddCnonce(Guid.NewGuid().ToString("N"));

        Console.WriteLine(DigestFields.Realm);
        Console.WriteLine(DigestFields.Nonce);
        Console.WriteLine(DigestFields.QualityOfProtection);
    }
}

Fields

Algorithm

The algorithm field of a HTTP Digest access authentication.

public const string Algorithm = "algorithm"

Field Value

string

ClientNonce

The client nonce (cnonce) field of a HTTP Digest access authentication.

public const string ClientNonce = "cnonce"

Field Value

string

DigestUri

The uri (digest URI) field of a HTTP Digest access authentication.

public const string DigestUri = "uri"

Field Value

string

Nonce

The nonce field of a HTTP Digest access authentication.

public const string Nonce = "nonce"

Field Value

string

NonceCount

The nc (nonce count) field of a HTTP Digest access authentication.

public const string NonceCount = "nc"

Field Value

string

Opaque

The opaque field of a HTTP Digest access authentication.

public const string Opaque = "opaque"

Field Value

string

QualityOfProtection

The qop (quality of protection) field of a HTTP Digest access authentication.

public const string QualityOfProtection = "qop"

Field Value

string

Realm

The realm field of a HTTP Digest access authentication.

public const string Realm = "realm"

Field Value

string

Response

The response field of a HTTP Digest access authentication.

public const string Response = "response"

Field Value

string

Stale

The stale field of a HTTP Digest access authentication.

public const string Stale = "stale"

Field Value

string

UserName

The username field of a HTTP Digest access authentication.

public const string UserName = "username"

Field Value

string