Class BasicFields
- Namespace
- Cuemon.AspNetCore.Authentication.Basic
- Assembly
- Cuemon.AspNetCore.Authentication.dll
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
Credentials
The credentials of the HTTP Basic access authentication.
public const string Credentials = "credentials"
Field Value
Password
The password of the Credentials.
public const string Password = "password"
Field Value
Realm
The realm field of a HTTP Basic access authentication.
public const string Realm = "realm"
Field Value
UserName
The username of the Credentials.
public const string UserName = "username"