Table of Contents

AuthorizationHeaderOptions Class

Definition

Namespace
Cuemon.AspNetCore.Authentication
Assemblies
Cuemon.AspNetCore.Authentication.dll
Source
src/Cuemon.AspNetCore.Authentication/AuthorizationHeaderOptions.cs

Configuration options for AuthorizationHeader.

public class AuthorizationHeaderOptions : IValidatableParameterObject, IParameterObject
Inheritance
AuthorizationHeaderOptions
Implements

Examples

The following example demonstrates how to customize the delimiters used when parsing authorization header credentials.

using System;
using Cuemon.AspNetCore.Authentication;

namespace MyApp.Examples;

public static class AuthorizationHeaderOptionsExample
{
    public static void Demonstrate()
    {
        var options = new AuthorizationHeaderOptions
        {
            CredentialsDelimiter = ", ",
            CredentialsKeyValueDelimiter = "="
        };

        options.ValidateOptions();

        Console.WriteLine(options.CredentialsDelimiter);
        Console.WriteLine(options.CredentialsKeyValueDelimiter);
    }
}

Constructors

Name Description
AuthorizationHeaderOptions()

Initializes a new instance of the AuthorizationHeaderOptions class.

Properties

Name Description
CredentialsDelimiter

Gets or sets the credentials delimiter.

CredentialsKeyValueDelimiter

Gets or sets the credentials key value delimiter.

Methods

Name Description
ValidateOptions()

Determines whether the public read-write properties of this instance are in a valid state.