Table of Contents

BasicFields Class

Definition

Namespace
Cuemon.AspNetCore.Authentication.Basic
Assemblies
Cuemon.AspNetCore.Authentication.dll
Source
src/Cuemon.AspNetCore.Authentication/Basic/BasicFields.cs

A collection of constants for BasicAuthorizationHeaderBuilder.

public static class BasicFields
Inheritance
BasicFields

Examples

The following example demonstrates how to use the field constants of BasicFields to construct a Basic authorization header.

using System;
using Cuemon.AspNetCore.Authentication.Basic;

namespace MyApp.Examples;

public static class BasicFieldsExample
{
    public static void Demonstrate()
    {
        var builder = new BasicAuthorizationHeaderBuilder();
        builder.AddUserName("alice");
        builder.AddPassword("s3cret");
        var header = builder.Build();

        Console.WriteLine(BasicAuthorizationHeader.Scheme);
        Console.WriteLine(BasicFields.Realm);
        Console.WriteLine(BasicFields.Credentials);
    }
}

Fields

Name Description
Credentials

The credentials of the HTTP Basic access authentication.

Password

The password of the Credentials.

Realm

The realm field of a HTTP Basic access authentication.

UserName

The username of the Credentials.