public class BearerTokenAuthenticationChallengePolicy extends Object implements HttpPipelinePolicy
Constructor and Description |
---|
BearerTokenAuthenticationChallengePolicy(TokenCredential credential,
String... scopes)
Creates BearerTokenAuthenticationChallengePolicy.
|
Modifier and Type | Method and Description |
---|---|
Mono<Void> |
authorizeRequest(HttpPipelineCallContext context)
Executed before sending the initial request and authenticates the request.
|
Mono<Boolean> |
authorizeRequestOnChallenge(HttpPipelineCallContext context,
HttpResponse response)
Handles the authentication challenge in the event a 401 response with a WWW-Authenticate authentication
challenge header is received after the initial request and returns appropriate
TokenRequestContext to
be used for re-authentication. |
Mono<HttpResponse> |
process(HttpPipelineCallContext context,
HttpPipelineNextPolicy next) |
Mono<Void> |
setAuthorizationHeader(HttpPipelineCallContext context,
TokenRequestContext tokenRequestContext)
Authorizes the request with the bearer token acquired using the specified
tokenRequestContext |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPipelinePosition
public BearerTokenAuthenticationChallengePolicy(TokenCredential credential, String... scopes)
credential
- the token credential to authenticate the requestscopes
- the scopes required for the tokenpublic Mono<Void> authorizeRequest(HttpPipelineCallContext context)
public Mono<Boolean> authorizeRequestOnChallenge(HttpPipelineCallContext context, HttpResponse response)
TokenRequestContext
to
be used for re-authentication.context
- The request context.response
- The Http Response containing the authentication challenge header.Mono
containing TokenRequestContext
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)
process
in interface HttpPipelinePolicy
public Mono<Void> setAuthorizationHeader(HttpPipelineCallContext context, TokenRequestContext tokenRequestContext)
tokenRequestContext
Copyright © 2021 Microsoft Corporation. All rights reserved.