Class AuthorizationHeaderBuilder
- Namespace
- Cuemon.AspNetCore.Authentication
- Assembly
- Cuemon.AspNetCore.Authentication.dll
The base class of an AuthorizationHeaderBuilder.
public abstract class AuthorizationHeaderBuilder
- Inheritance
-
AuthorizationHeaderBuilder
- Derived
Constructors
AuthorizationHeaderBuilder(string)
Initializes a new instance of the AuthorizationHeaderBuilder class.
protected AuthorizationHeaderBuilder(string authenticationScheme)
Parameters
authenticationSchemestringThe name of the authentication scheme.
Properties
AuthenticationScheme
Gets the name of the authentication scheme.
public string AuthenticationScheme { get; }
Property Value
- string
The name of the authentication scheme.
Data
Gets the fields added to this instance.
protected IDictionary<string, string> Data { get; }
Property Value
- IDictionary<string, string>
The fields added to this instance.
Relation
Gets the relations added to this instance.
protected IDictionary<string, string> Relation { get; }
Property Value
- IDictionary<string, string>
The relations added to this instance.
Methods
MapRelation(string, params string[])
Maps the logical relation between a memberName and the fieldNames associated.
protected void MapRelation(string memberName, params string[] fieldNames)
Parameters
memberNamestringThe name of a member.
fieldNamesstring[]The field names to associate with
memberName.
ToImmutableDictionary()
Converts this instance to an ImmutableDictionary<TKey, TValue>.
public ImmutableDictionary<string, string> ToImmutableDictionary()
Returns
- ImmutableDictionary<string, string>
An ImmutableDictionary<TKey, TValue> equivalent of this instance.
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
ValidateData(params string[])
Validates that any requiredFieldNames has been added to Data.
protected void ValidateData(params string[] requiredFieldNames)
Parameters
requiredFieldNamesstring[]The required field names to validate.
Exceptions
- ArgumentException
The required field is missing.