Table of Contents

Class HmacAuthorizationHeader

Namespace
Cuemon.AspNetCore.Authentication.Hmac
Assembly
Cuemon.AspNetCore.Authentication.dll

Provides a representation of a HTTP HMAC Authentication header. Implements the AuthorizationHeader

public class HmacAuthorizationHeader : AuthorizationHeader
Inheritance
HmacAuthorizationHeader
Inherited Members

Constructors

HmacAuthorizationHeader(String, String, String, String, String)

Initializes a new instance of the HmacAuthorizationHeader class.

public HmacAuthorizationHeader(string clientId, string credentialScope, string signedHeaders, string signature, string authenticationScheme = "HMAC")

Parameters

clientId String

The client identifier that is the public key of the signing process.

credentialScope String

The credential scope that defines the remote resource.

signedHeaders String

The headers that will be part of the signing process.

signature String

The signature that represents the integrity of this header.

authenticationScheme String

The authentication scheme of this header. Default is Scheme (HMAC).

Properties

ClientId

Gets the client identifier that is the public key of the signing process.

public string ClientId { get; }

Property Value

String

The client identifier that is the public key of the signing process.

CredentialScope

Gets the credential scope that defines the remote resource.

public string CredentialScope { get; }

Property Value

String

The credential scope that defines the remote resource.

Signature

Gets the signature that represents the integrity of this header.

public string Signature { get; }

Property Value

String

The signature that represents the integrity of this header.

SignedHeaders

Gets the headers that will be part of the signing process.

public string[] SignedHeaders { get; }

Property Value

String[]

The headers that will be part of the signing process.

Methods

Create(String, String, Action<AuthorizationHeaderOptions>)

Creates an instance of HmacAuthorizationHeader from the specified parameters.

public static HmacAuthorizationHeader Create(string authenticationScheme, string authorizationHeader, Action<AuthorizationHeaderOptions> setup = null)

Parameters

authenticationScheme String

The name of the authentication scheme.

authorizationHeader String

The raw HTTP authorization header.

setup Action<AuthorizationHeaderOptions>

The AuthorizationHeaderOptions which may be configured.

Returns

HmacAuthorizationHeader

An instance of HmacAuthorizationHeader.

Exceptions

ArgumentNullException

authenticationScheme cannot be null -or- authorizationHeader cannot be null.

ArgumentException

authenticationScheme cannot be empty or consist only of white-space characters -or- authorizationHeader cannot be empty or consist only of white-space characters.

ParseCore(IReadOnlyDictionary<String, String>)

The core parser that resolves an AuthorizationHeader from a set of credentials.

protected override AuthorizationHeader ParseCore(IReadOnlyDictionary<string, string> credentials)

Parameters

credentials IReadOnlyDictionary<String, String>

The credentials used in authentication.

Returns

AuthorizationHeader

An AuthorizationHeader equivalent of credentials.

ToString()

Returns a String that represents this instance.

public override string ToString()

Returns

String

A String that represents this instance.

See Also