Table of Contents

HmacAuthorizationHeader Class

Definition

Namespace
Cuemon.AspNetCore.Authentication.Hmac
Assemblies
Cuemon.AspNetCore.Authentication.dll
Source
src/Cuemon.AspNetCore.Authentication/Hmac/HmacAuthorizationHeader.cs

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

public class HmacAuthorizationHeader : AuthorizationHeader
Inheritance
HmacAuthorizationHeader
Inherited Members

Examples

The following example demonstrates how to parse an HMAC Authorization header value.

using Cuemon.AspNetCore.Authentication.Hmac;

namespace MyApp.Examples;

public class HmacAuthorizationHeaderExample
{
    public void Demonstrate()
    {
        var header = HmacAuthorizationHeader.Create(
            HmacFields.Scheme,
            "HMAC Credential=alice/some-scope, SignedHeaders=date;host, Signature=abc123");
        var clientId = header.ClientId; // "alice"
    }
}

Constructors

Name Description
HmacAuthorizationHeader(string, string, string, string, string)

Initializes a new instance of the HmacAuthorizationHeader class.

Properties

Name Description
ClientId

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

CredentialScope

Gets the credential scope that defines the remote resource.

Signature

Gets the signature that represents the integrity of this header.

SignedHeaders

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

Methods

Name Description
Create(string, string, Action<AuthorizationHeaderOptions>)

Creates an instance of HmacAuthorizationHeader from the specified parameters.

ParseCore(IReadOnlyDictionary<string, string>)

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

ToString()

Returns a string that represents this instance.

See Also