Language

BaseAuthorizationHeaderProvider Class

Definition

Base class for custom implementations of IAuthorizationHeaderProvider that would still want to leverage the default implementation for the bearer and Pop protocols.

public class BaseAuthorizationHeaderProvider : Microsoft.Identity.Abstractions.IAuthorizationHeaderProvider2
type BaseAuthorizationHeaderProvider = class
    interface IAuthorizationHeaderProvider2
    interface IAuthorizationHeaderProvider
Public Class BaseAuthorizationHeaderProvider
Implements IAuthorizationHeaderProvider2
Inheritance
BaseAuthorizationHeaderProvider
Implements

Remarks

Also implements IAuthorizationHeaderProvider2 (added in Microsoft.Identity.Abstractions 12.3.0) so subclasses automatically expose the metadata-rich header-creation surface without needing to opt in. Override the CreateAuthorizationHeaderInformation* virtuals to customize that path.

Constructors

Name Description
BaseAuthorizationHeaderProvider(IServiceProvider)

Constructor from a service provider

Methods

Name Description
CreateAuthorizationHeaderAsync(IEnumerable<String>, AuthorizationHeaderProviderOptions, ClaimsPrincipal, CancellationToken)

Creates an authorization header for calling a protected web API on behalf of a user or the application.

CreateAuthorizationHeaderForAppAsync(String, AuthorizationHeaderProviderOptions, CancellationToken)

Creates the authorization header used to call a protected web API on behalf of the application itself.

CreateAuthorizationHeaderForUserAsync(IEnumerable<String>, AuthorizationHeaderProviderOptions, ClaimsPrincipal, CancellationToken)

Creates the authorization header used to call a protected web API on behalf of a user.

CreateAuthorizationHeaderInformationAsync(IEnumerable<String>, AuthorizationHeaderProviderOptions, ClaimsPrincipal, CancellationToken)

Rich-result counterpart of CreateAuthorizationHeaderAsync(IEnumerable<String>, AuthorizationHeaderProviderOptions, ClaimsPrincipal, CancellationToken): creates an authorization header for calling a protected web API on behalf of a user or the application and returns the full AuthorizationHeaderInformation on success, with metadata and (when the protocol is bound) the binding certificate populated. On failure the AuthorizationHeaderError carries the token-acquisition metadata and structured failure details when available.

CreateAuthorizationHeaderInformationForAppAsync(String, AuthorizationHeaderProviderOptions, CancellationToken)

Rich-result counterpart of CreateAuthorizationHeaderForAppAsync(String, AuthorizationHeaderProviderOptions, CancellationToken): creates the authorization header used to call a protected web API on behalf of the application itself and returns the full AuthorizationHeaderInformation on success, with metadata and (when the protocol is bound) the binding certificate populated. On failure the AuthorizationHeaderError carries the token-acquisition metadata and structured failure details when available.

CreateAuthorizationHeaderInformationForUserAsync(IEnumerable<String>, AuthorizationHeaderProviderOptions, ClaimsPrincipal, CancellationToken)

Rich-result counterpart of CreateAuthorizationHeaderForUserAsync(IEnumerable<String>, AuthorizationHeaderProviderOptions, ClaimsPrincipal, CancellationToken): creates the authorization header used to call a protected web API on behalf of a user and returns the full AuthorizationHeaderInformation on success, with metadata and (when the protocol is bound) the binding certificate populated. On failure the AuthorizationHeaderError carries the token-acquisition metadata and structured failure details when available.

Applies to