IBoundAuthorizationHeaderProvider.CreateBoundAuthorizationHeaderAsync 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 with either unbound or bound to certificate tokens.
public System.Threading.Tasks.Task<Microsoft.Identity.Abstractions.OperationResult<Microsoft.Identity.Abstractions.AuthorizationHeaderInformation,Microsoft.Identity.Abstractions.AuthorizationHeaderError>> CreateBoundAuthorizationHeaderAsync(Microsoft.Identity.Abstractions.DownstreamApiOptions downstreamApiOptions, System.Security.Claims.ClaimsPrincipal? claimsPrincipal = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateBoundAuthorizationHeaderAsync : Microsoft.Identity.Abstractions.DownstreamApiOptions * System.Security.Claims.ClaimsPrincipal * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Identity.Abstractions.OperationResult<Microsoft.Identity.Abstractions.AuthorizationHeaderInformation, Microsoft.Identity.Abstractions.AuthorizationHeaderError>>
Public Function CreateBoundAuthorizationHeaderAsync (downstreamApiOptions As DownstreamApiOptions, Optional claimsPrincipal As ClaimsPrincipal = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of OperationResult(Of AuthorizationHeaderInformation, AuthorizationHeaderError))
Parameters
- downstreamApiOptions
- DownstreamApiOptions
Information about the API that will be called and token acquisition options.
- claimsPrincipal
- ClaimsPrincipal
Inbound authentication elements. In a web API, this is usually the result of the validation of a token. In a web app, this would be information about the signed-in user. This is not useful in daemon applications. In Microsoft.Identity.Web you rarely need to provide this parameter as it's inferred from the context.
- cancellationToken
- CancellationToken
Cancellation token.
Returns
A result which contains authorization token with optional bound certificate