Share via


IAuthorizationHeaderProvider.CreateAuthorizationHeaderForAppAsync Method

Definition

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

public System.Threading.Tasks.Task<string> CreateAuthorizationHeaderForAppAsync (string scopes, Microsoft.Identity.Abstractions.AuthorizationHeaderProviderOptions? downstreamApiOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateAuthorizationHeaderForAppAsync : string * Microsoft.Identity.Abstractions.AuthorizationHeaderProviderOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function CreateAuthorizationHeaderForAppAsync (scopes As String, Optional downstreamApiOptions As AuthorizationHeaderProviderOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)

Parameters

scopes
String

Scopes for which to request the authorization header.

downstreamApiOptions
AuthorizationHeaderProviderOptions

Information about the API that will be called (for some protocols like Pop), and token acquisition options. Optional. If not provided, the authentication header will be for a bearer token.

cancellationToken
CancellationToken

Cancellation token.

Returns

A string containing the authorization header, that is protocol and tokens (for instance: "Bearer token", "PoP token", etc ...).

Applies to