public class BearerRestConnection extends DefaultRestConnection
DefaultRestConnection for resources protected with OAuth, regardless of the grant type.
The main features of this connection are that:
CompletableFuture will be completed with
an AccessTokenExpiredException so that the SDK triggers the refresh token workflow.| Constructor and Description |
|---|
BearerRestConnection(String baseUri,
String configName,
org.mule.runtime.http.api.client.HttpClient httpClient,
org.mule.runtime.http.api.client.auth.HttpAuthentication authentication,
org.mule.runtime.api.util.MultiMap<String,String> defaultQueryParams,
org.mule.runtime.api.util.MultiMap<String,String> defaultHeaders,
org.mule.runtime.api.el.ExpressionLanguage expressionLanguage,
String token)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
protected org.mule.runtime.http.api.domain.message.request.HttpRequest |
buildRequest(RestRequestBuilder requestBuilder) |
afterStop, beforeStop, bodylessRequest, getBaseUri, getExpressionLanguage, handleResponseError, request, stop, toAttributes, toResult, validatepublic BearerRestConnection(String baseUri, String configName, org.mule.runtime.http.api.client.HttpClient httpClient, org.mule.runtime.http.api.client.auth.HttpAuthentication authentication, org.mule.runtime.api.util.MultiMap<String,String> defaultQueryParams, org.mule.runtime.api.util.MultiMap<String,String> defaultHeaders, org.mule.runtime.api.el.ExpressionLanguage expressionLanguage, String token)
baseUri - the service base uriconfigName - the name of the config that owns this connectionhttpClient - the client to useauthentication - the authentication mechanism to use, or nulldefaultQueryParams - query params to be automatically added to all requests done through this connectiondefaultHeaders - headers to be automatically added to all requests done through this connectionoauthState - the OAuthState for the current connectionresourceOwnerId - the id of the resource owner for this connectionexpressionLanguage - refreshTokenCondition - protected org.mule.runtime.http.api.domain.message.request.HttpRequest buildRequest(RestRequestBuilder requestBuilder)
buildRequest in class DefaultRestConnectionCopyright © 2021. All rights reserved.