BaseAuthorizationHeaderProvider.CreateAuthorizationHeaderForAppAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates the authorization header used to call a protected web API on behalf of the application itself.
public virtual 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>
override this.CreateAuthorizationHeaderForAppAsync : string * Microsoft.Identity.Abstractions.AuthorizationHeaderProviderOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Overridable 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 ...).