Table of Contents

DigestFields Class

Definition

Namespace
Cuemon.AspNetCore.Authentication.Digest
Assemblies
Cuemon.AspNetCore.Authentication.dll
Source
src/Cuemon.AspNetCore.Authentication/Digest/DigestFields.cs

A collection of constants for DigestAuthorizationHeaderBuilder.

public static class DigestFields
Inheritance
object
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

Name Description
Algorithm

The algorithm field of a HTTP Digest access authentication.

ClientNonce

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

DigestUri

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

Nonce

The nonce field of a HTTP Digest access authentication.

NonceCount

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

Opaque

The opaque field of a HTTP Digest access authentication.

QualityOfProtection

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

Realm

The realm field of a HTTP Digest access authentication.

Response

The response field of a HTTP Digest access authentication.

Stale

The stale field of a HTTP Digest access authentication.

UserName

The username field of a HTTP Digest access authentication.