public class DefaultOAuthAuthorizationCodeDancerBuilder extends AbstractOAuthDancerBuilder<AuthorizationCodeOAuthDancer> implements OAuthAuthorizationCodeDancerBuilder
clientCredentialsLocation, clientId, clientSecret, customParametersExtractorsExprs, encoding, expressionEvaluator, httpClientFactory, lockProvider, name, resourceOwnerIdTransformer, responseAccessTokenExpr, responseExpiresInExpr, responseRefreshTokenExpr, schedulerService, scopes, tokensStore, tokenUrl| Constructor and Description |
|---|
DefaultOAuthAuthorizationCodeDancerBuilder(org.mule.runtime.api.scheduler.SchedulerService schedulerService,
org.mule.runtime.api.lock.LockFactory lockProvider,
Map<String,ResourceOwnerOAuthContext> tokensStore,
org.mule.runtime.http.api.HttpService httpService,
HttpClientFactory httpClientFactory,
org.mule.runtime.api.el.MuleExpressionLanguage expressionEvaluator) |
| Modifier and Type | Method and Description |
|---|---|
OAuthAuthorizationCodeDancerBuilder |
addAdditionalRefreshTokenRequestHeaders(org.mule.runtime.api.util.MultiMap<String,String> additionalHeaders)
Adds additional request headers for refreshing the token
|
OAuthAuthorizationCodeDancerBuilder |
addAdditionalRefreshTokenRequestParameters(org.mule.runtime.api.util.MultiMap<String,String> additionalParameters)
Adds additional request parameters for refreshing the token
|
OAuthAuthorizationCodeDancerBuilder |
addListener(AuthorizationCodeListener listener)
Adds the provided
listener |
OAuthAuthorizationCodeDancerBuilder |
afterDanceCallback(BiConsumer<AuthorizationCodeDanceCallbackContext,ResourceOwnerOAuthContext> afterDanceCallback)
Allows custom code to be run after doing the request to the provided
tokenUrl and processing its results. |
OAuthAuthorizationCodeDancerBuilder |
authorizationUrl(String authorizationUrl) |
OAuthAuthorizationCodeDancerBuilder |
beforeDanceCallback(Function<AuthorizationCodeRequest,AuthorizationCodeDanceCallbackContext> beforeDanceCallback)
Allows custom code to be run just before doing the request to the provided
tokenUrl. |
AuthorizationCodeOAuthDancer |
build()
Uses the configuration provided to this builder to create a new dancer.
|
OAuthAuthorizationCodeDancerBuilder |
customHeaders(Map<String,String> customHeaders)
There are OAuth implementations that require or allow extra headers to be sent when calling the Authentication URL of the
OAS.
|
OAuthAuthorizationCodeDancerBuilder |
customHeaders(Supplier<Map<String,String>> customHeaders)
There are OAuth implementations that require or allow extra headers to be sent when calling the Authentication URL of the
OAS.
|
OAuthAuthorizationCodeDancerBuilder |
customParameters(Map<String,String> customParameters)
There are OAuth implementations that require or allow extra query parameters to be sent when calling the Authentication URL
of the OAS.
|
OAuthAuthorizationCodeDancerBuilder |
customParameters(Supplier<Map<String,String>> customParameters)
There are OAuth implementations that require or allow extra query parameters to be sent when calling the Authentication URL
of the OAS.
|
OAuthAuthorizationCodeDancerBuilder |
encodeClientCredentialsInBody(boolean encodeClientCredentialsInBody) |
OAuthAuthorizationCodeDancerBuilder |
externalCallbackUrl(String externalCallbackUrl)
The oauth authentication server will use this url to provide the authentication code to the Mule server so the mule server
can retrieve the access token.
|
OAuthAuthorizationCodeDancerBuilder |
includeRedirectUriInRefreshTokenRequest(boolean includeRedirectUriInRefreshTokenRequest)
Allows to toggle the inclusion of a redirect_uri parameter on the refresh token request.
|
OAuthAuthorizationCodeDancerBuilder |
localAuthorizationUrlPath(String path)
If this attribute is provided mule will automatically create and endpoint in the host server (the same configured for
OAuthAuthorizationCodeDancerBuilder.localCallback(java.net.URL)) that the user can hit to authenticate and grant access to the application for his account. |
OAuthAuthorizationCodeDancerBuilder |
localAuthorizationUrlResourceOwnerId(String localAuthorizationUrlResourceOwnerIdExpr)
This attribute is only required when the applications needs to access resources from more than one user in the OAuth
authentication server.
|
OAuthAuthorizationCodeDancerBuilder |
localCallback(org.mule.runtime.http.api.server.HttpServer server,
String localCallbackConfigPath)
The produced
AuthorizationCodeOAuthDancer will use an existing HttpServer to listen on the provided
localCallbackConfigPath. |
OAuthAuthorizationCodeDancerBuilder |
localCallback(URL localCallbackUrl)
The produced
AuthorizationCodeOAuthDancer will create an HttpServer to listen on the provided
localCallbackUrl. |
OAuthAuthorizationCodeDancerBuilder |
localCallback(URL localCallbackUrl,
org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory)
The produced
AuthorizationCodeOAuthDancer will create an HttpServer with the provided
tlsContextFactory to listen on the provided localCallbackUrl. |
OAuthAuthorizationCodeDancerBuilder |
state(String stateExpr)
Mule will add some internal stuff to the state that is sent to the Authorization server.
|
clientCredentials, customParametersExtractorsExprs, encoding, name, resourceOwnerIdTransformer, responseAccessTokenExpr, responseExpiresInExpr, responseRefreshTokenExpr, scopes, tokenUrl, tokenUrl, tokenUrl, tokenUrl, tokenUrl, withClientCredentialsInclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclientCredentials, customParametersExtractorsExprs, encoding, name, resourceOwnerIdTransformer, responseAccessTokenExpr, responseExpiresInExpr, responseRefreshTokenExpr, scopes, tokenUrl, tokenUrl, tokenUrl, tokenUrl, tokenUrl, withClientCredentialsInpublic DefaultOAuthAuthorizationCodeDancerBuilder(org.mule.runtime.api.scheduler.SchedulerService schedulerService,
org.mule.runtime.api.lock.LockFactory lockProvider,
Map<String,ResourceOwnerOAuthContext> tokensStore,
org.mule.runtime.http.api.HttpService httpService,
HttpClientFactory httpClientFactory,
org.mule.runtime.api.el.MuleExpressionLanguage expressionEvaluator)
public OAuthAuthorizationCodeDancerBuilder localCallback(URL localCallbackUrl)
OAuthAuthorizationCodeDancerBuilderAuthorizationCodeOAuthDancer will create an HttpServer to listen on the provided
localCallbackUrl.localCallback in interface OAuthAuthorizationCodeDancerBuilderlocalCallbackUrl - the url to listen onpublic OAuthAuthorizationCodeDancerBuilder localCallback(URL localCallbackUrl, org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory)
OAuthAuthorizationCodeDancerBuilderAuthorizationCodeOAuthDancer will create an HttpServer with the provided
tlsContextFactory to listen on the provided localCallbackUrl.localCallback in interface OAuthAuthorizationCodeDancerBuilderlocalCallbackUrl - the url to listen ontlsContextFactory - the TLS context to use for the listenerpublic OAuthAuthorizationCodeDancerBuilder localCallback(org.mule.runtime.http.api.server.HttpServer server, String localCallbackConfigPath)
OAuthAuthorizationCodeDancerBuilderAuthorizationCodeOAuthDancer will use an existing HttpServer to listen on the provided
localCallbackConfigPath.localCallback in interface OAuthAuthorizationCodeDancerBuilderserver - a server listening on a specific host and portlocalCallbackConfigPath - the path on the server to listen onpublic OAuthAuthorizationCodeDancerBuilder localAuthorizationUrlPath(String path)
OAuthAuthorizationCodeDancerBuilderOAuthAuthorizationCodeDancerBuilder.localCallback(java.net.URL)) that the user can hit to authenticate and grant access to the application for his account.localAuthorizationUrlPath in interface OAuthAuthorizationCodeDancerBuilderpath - the path to listen for the callbackpublic OAuthAuthorizationCodeDancerBuilder localAuthorizationUrlResourceOwnerId(String localAuthorizationUrlResourceOwnerIdExpr)
OAuthAuthorizationCodeDancerBuilderlocalAuthorizationUrlResourceOwnerId in interface OAuthAuthorizationCodeDancerBuilderlocalAuthorizationUrlResourceOwnerIdExpr - expression to get the identifier under which the oauth authentication
attributes are stored (accessToken, refreshToken, etc).public OAuthAuthorizationCodeDancerBuilder customParameters(Map<String,String> customParameters)
OAuthAuthorizationCodeDancerBuilder
Invoking this method overrides any prior invokations to OAuthAuthorizationCodeDancerBuilder.customParameters(Supplier)
customParameters in interface OAuthAuthorizationCodeDancerBuildercustomParameters - the extra parameters to be sent with the authorization request to OAuthAuthorizationCodeDancerBuilder.authorizationUrl(String).public OAuthAuthorizationCodeDancerBuilder customParameters(Supplier<Map<String,String>> customParameters)
OAuthAuthorizationCodeDancerBuilder
Invoking this method overrides any prior invokations to OAuthAuthorizationCodeDancerBuilder.customParameters(Map)
customParameters in interface OAuthAuthorizationCodeDancerBuildercustomParameters - A Supplier the extra parameters to be sent with the authorization request to
OAuthAuthorizationCodeDancerBuilder.authorizationUrl(String).public OAuthAuthorizationCodeDancerBuilder customHeaders(Map<String,String> customHeaders)
OAuthAuthorizationCodeDancerBuilder
Invoking this method overrides any prior invokations to OAuthAuthorizationCodeDancerBuilder.customHeaders(Supplier)
customHeaders in interface OAuthAuthorizationCodeDancerBuildercustomHeaders - the extra headers to be sent with the authorization request to OAuthAuthorizationCodeDancerBuilder.authorizationUrl(String).public OAuthAuthorizationCodeDancerBuilder customHeaders(Supplier<Map<String,String>> customHeaders)
OAuthAuthorizationCodeDancerBuilder
Invoking this method overrides any prior invokations to OAuthAuthorizationCodeDancerBuilder.customParameters(Map)
customHeaders in interface OAuthAuthorizationCodeDancerBuildercustomHeaders - A Supplier the extra headers to be sent with the authorization request to
OAuthAuthorizationCodeDancerBuilder.authorizationUrl(String).public OAuthAuthorizationCodeDancerBuilder state(String stateExpr)
OAuthAuthorizationCodeDancerBuilderstate as specified in this method will be honored.state in interface OAuthAuthorizationCodeDancerBuilderstateExpr - parameter for holding state between the authentication request and the callback done by the OAuth
authorization server to the OAuthAuthorizationCodeDancerBuilder.externalCallbackUrl(String).public OAuthAuthorizationCodeDancerBuilder authorizationUrl(String authorizationUrl)
authorizationUrl in interface OAuthAuthorizationCodeDancerBuilderauthorizationUrl - The OAuth authentication server url to authorize the app for a certain user.public OAuthAuthorizationCodeDancerBuilder externalCallbackUrl(String externalCallbackUrl)
OAuthAuthorizationCodeDancerBuilder
Note: this must be the externally visible address of the OAuthAuthorizationCodeDancerBuilder.localCallback(java.net.URL).
TODO MULE-11861: Allow to infer the localCallback url based on the externalCallbackUrl for Auth-code grant-type
externalCallbackUrl in interface OAuthAuthorizationCodeDancerBuilderexternalCallbackUrl - the callback url where the authorization code will be received.public OAuthAuthorizationCodeDancerBuilder beforeDanceCallback(Function<AuthorizationCodeRequest,AuthorizationCodeDanceCallbackContext> beforeDanceCallback)
OAuthAuthorizationCodeDancerBuildertokenUrl.
The map returned by the provided function will be passed to the OAuthAuthorizationCodeDancerBuilder.afterDanceCallback(BiConsumer), if set.
beforeDanceCallback in interface OAuthAuthorizationCodeDancerBuilderbeforeDanceCallback - a Function that receives the parameters that will be used in the executing dance and returns an
AuthorizationCodeDanceCallbackContext to be then passed to the
OAuthAuthorizationCodeDancerBuilder.afterDanceCallback(BiConsumer). Not null.public OAuthAuthorizationCodeDancerBuilder afterDanceCallback(BiConsumer<AuthorizationCodeDanceCallbackContext,ResourceOwnerOAuthContext> afterDanceCallback)
OAuthAuthorizationCodeDancerBuildertokenUrl and processing its results.afterDanceCallback in interface OAuthAuthorizationCodeDancerBuilderafterDanceCallback - a BiConsumer that receives the AuthorizationCodeDanceCallbackContext returned by the callback
passed to OAuthAuthorizationCodeDancerBuilder.beforeDanceCallback(Function) and the OAuth context from the response of the call to
tokenUrl. Not null.public OAuthAuthorizationCodeDancerBuilder encodeClientCredentialsInBody(boolean encodeClientCredentialsInBody)
encodeClientCredentialsInBody in interface OAuthAuthorizationCodeDancerBuilderencodeClientCredentialsInBody in class AbstractOAuthDancerBuilder<AuthorizationCodeOAuthDancer>encodeClientCredentialsInBody - If @{code true}, the client id and client secret will be sent in the request body.
Otherwise, they will be sent as basic authentication.public OAuthAuthorizationCodeDancerBuilder addListener(AuthorizationCodeListener listener)
OAuthAuthorizationCodeDancerBuilderlisteneraddListener in interface OAuthAuthorizationCodeDancerBuilderlistener - a AuthorizationCodeListenerthis builderpublic OAuthAuthorizationCodeDancerBuilder addAdditionalRefreshTokenRequestParameters(org.mule.runtime.api.util.MultiMap<String,String> additionalParameters)
OAuthAuthorizationCodeDancerBuilderaddAdditionalRefreshTokenRequestParameters in interface OAuthAuthorizationCodeDancerBuilderadditionalParameters - a Map that contains the additional parameters to be includedthis builderpublic OAuthAuthorizationCodeDancerBuilder addAdditionalRefreshTokenRequestHeaders(org.mule.runtime.api.util.MultiMap<String,String> additionalHeaders)
OAuthAuthorizationCodeDancerBuilderaddAdditionalRefreshTokenRequestHeaders in interface OAuthAuthorizationCodeDancerBuilderadditionalHeaders - a Map that contains the additional headers to be includedthis builderpublic OAuthAuthorizationCodeDancerBuilder includeRedirectUriInRefreshTokenRequest(boolean includeRedirectUriInRefreshTokenRequest)
OAuthAuthorizationCodeDancerBuilderincludeRedirectUriInRefreshTokenRequest in interface OAuthAuthorizationCodeDancerBuilderincludeRedirectUriInRefreshTokenRequest - a boolean that decides if the parameter should be sent or notthis builderpublic AuthorizationCodeOAuthDancer build()
OAuthDancerBuilderbuild in interface OAuthDancerBuilder<AuthorizationCodeOAuthDancer>Copyright © 2022. All rights reserved.