public abstract class AbstractOAuthDancerBuilder<D> extends Object implements OAuthDancerBuilder<D>
| Modifier and Type | Field and Description |
|---|---|
protected ClientCredentialsLocation |
clientCredentialsLocation |
protected String |
clientId |
protected String |
clientSecret |
protected Map<String,String> |
customParametersExtractorsExprs |
protected Charset |
encoding |
protected org.mule.runtime.api.el.MuleExpressionLanguage |
expressionEvaluator |
protected Supplier<org.mule.runtime.http.api.client.HttpClient> |
httpClientFactory |
protected org.mule.runtime.api.lock.LockFactory |
lockProvider |
protected String |
name |
protected Function<String,String> |
resourceOwnerIdTransformer |
protected String |
responseAccessTokenExpr |
protected String |
responseExpiresInExpr |
protected String |
responseRefreshTokenExpr |
protected org.mule.runtime.api.scheduler.SchedulerService |
schedulerService |
protected String |
scopes |
protected Map<String,ResourceOwnerOAuthContext> |
tokensStore |
protected String |
tokenUrl |
| Constructor and Description |
|---|
AbstractOAuthDancerBuilder(org.mule.runtime.api.scheduler.SchedulerService schedulerService,
org.mule.runtime.api.lock.LockFactory lockProvider,
Map<String,ResourceOwnerOAuthContext> tokensStore,
HttpClientFactory baseHttpClientFactory,
org.mule.runtime.api.el.MuleExpressionLanguage expressionEvaluator) |
| Modifier and Type | Method and Description |
|---|---|
OAuthDancerBuilder |
clientCredentials(String clientId,
String clientSecret) |
OAuthDancerBuilder |
customParametersExtractorsExprs(Map<String,String> customParamsExtractorsExprs) |
OAuthDancerBuilder |
encodeClientCredentialsInBody(boolean encodeClientCredentialsInBody)
Deprecated.
|
OAuthDancerBuilder |
encoding(Charset encoding) |
OAuthDancerBuilder<D> |
name(String name) |
OAuthDancerBuilder<D> |
resourceOwnerIdTransformer(Function<String,String> resourceOwnerIdTransformer)
Allows to partition a
tokensStore and reuse it among different dancers, as long as each dancer has its own proper
resourceOwnerIdStoreTransformer and ensures there can be no collissions between the transformed
resourceOwnerIds for different dancers. |
OAuthDancerBuilder |
responseAccessTokenExpr(String responseAccessTokenExpr) |
OAuthDancerBuilder |
responseExpiresInExpr(String responseExpiresInExpr) |
OAuthDancerBuilder |
responseRefreshTokenExpr(String responseRefreshTokenExpr) |
OAuthDancerBuilder |
scopes(String scopes)
Scopes define permissions over resources.
|
OAuthDancerBuilder |
tokenUrl(org.mule.runtime.http.api.client.HttpClient httpClient,
String tokenUrl)
Mule, after receiving the authentication code from the OAuth server (through the redirectUrl) will call this url to get the
access token.
|
OAuthDancerBuilder |
tokenUrl(String tokenUrl)
Mule, after receiving the authentication code from the OAuth server (through the redirectUrl) will call this url to get the
access token.
|
OAuthDancerBuilder<D> |
tokenUrl(String tokenUrl,
org.mule.runtime.http.api.client.proxy.ProxyConfig proxyConfig)
Mule, after receiving the authentication code from the OAuth server (through the redirectUrl) will call this url to get the
access token.
|
OAuthDancerBuilder |
tokenUrl(String tokenUrl,
org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory)
Mule, after receiving the authentication code from the OAuth server (through the redirectUrl) will call this url to get the
access token.
|
OAuthDancerBuilder<D> |
tokenUrl(String tokenUrl,
org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory,
org.mule.runtime.http.api.client.proxy.ProxyConfig proxyConfig)
Mule, after receiving the authentication code from the OAuth server (through the redirectUrl) will call this url to get the
access token.
|
OAuthDancerBuilder |
withClientCredentialsIn(ClientCredentialsLocation clientCredentialsLocation)
Define where the client credentials will be sent in the HTTP requests for the OAuth2 Dance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildprotected final org.mule.runtime.api.scheduler.SchedulerService schedulerService
protected final org.mule.runtime.api.lock.LockFactory lockProvider
protected final Map<String,ResourceOwnerOAuthContext> tokensStore
protected final org.mule.runtime.api.el.MuleExpressionLanguage expressionEvaluator
protected String name
protected String clientId
protected String clientSecret
protected ClientCredentialsLocation clientCredentialsLocation
protected String tokenUrl
protected Supplier<org.mule.runtime.http.api.client.HttpClient> httpClientFactory
protected Charset encoding
protected String responseAccessTokenExpr
protected String responseRefreshTokenExpr
protected String responseExpiresInExpr
protected String scopes
public AbstractOAuthDancerBuilder(org.mule.runtime.api.scheduler.SchedulerService schedulerService,
org.mule.runtime.api.lock.LockFactory lockProvider,
Map<String,ResourceOwnerOAuthContext> tokensStore,
HttpClientFactory baseHttpClientFactory,
org.mule.runtime.api.el.MuleExpressionLanguage expressionEvaluator)
public OAuthDancerBuilder<D> name(String name)
name in interface OAuthDancerBuilder<D>name - the name for this dancer to use for ids generationpublic OAuthDancerBuilder clientCredentials(String clientId, String clientSecret)
clientCredentials in interface OAuthDancerBuilder<D>clientId - the application identifier as defined in the OAuth authentication server.clientSecret - the application secret as defined in the OAuth authentication server.@Deprecated public OAuthDancerBuilder encodeClientCredentialsInBody(boolean encodeClientCredentialsInBody)
public OAuthDancerBuilder withClientCredentialsIn(ClientCredentialsLocation clientCredentialsLocation)
OAuthDancerBuilderwithClientCredentialsIn in interface OAuthDancerBuilder<D>clientCredentialsLocation - location of the credentials in an HTTP request.public OAuthDancerBuilder tokenUrl(String tokenUrl)
OAuthDancerBuildertokenUrl in interface OAuthDancerBuilder<D>tokenUrl - The OAuth authentication server url to get access to the token.public OAuthDancerBuilder tokenUrl(org.mule.runtime.http.api.client.HttpClient httpClient, String tokenUrl)
OAuthDancerBuildertokenUrl in interface OAuthDancerBuilder<D>httpClient - the HttpClient that will be used to do the HTTP request for the token during the OAuth dance.tokenUrl - The OAuth authentication server url to get access to the token.public OAuthDancerBuilder<D> tokenUrl(String tokenUrl, org.mule.runtime.http.api.client.proxy.ProxyConfig proxyConfig)
OAuthDancerBuildertokenUrl in interface OAuthDancerBuilder<D>tokenUrl - The OAuth authentication server url to get access to the token.proxyConfig - References the proxy configuration which through the HTTP request will go during the request.public OAuthDancerBuilder tokenUrl(String tokenUrl, org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory)
OAuthDancerBuildertokenUrl in interface OAuthDancerBuilder<D>tokenUrl - The OAuth authentication server url to get access to the token.tlsContextFactory - References a TLS config that will be used to do HTTP request during the OAuth dance.public OAuthDancerBuilder<D> tokenUrl(String tokenUrl, org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory, org.mule.runtime.http.api.client.proxy.ProxyConfig proxyConfig)
OAuthDancerBuildertokenUrl in interface OAuthDancerBuilder<D>tokenUrl - The OAuth authentication server url to get access to the token.tlsContextFactory - References a TLS config that will be used to do HTTP request during the OAuth dance.proxyConfig - References the proxy configuration which through the HTTP request will go during the request.public OAuthDancerBuilder scopes(String scopes)
OAuthDancerBuilderscopes in interface OAuthDancerBuilder<D>scopes - required by this application to execute.public OAuthDancerBuilder encoding(Charset encoding)
encoding in interface OAuthDancerBuilder<D>encoding - the encoding to use when processing the incoming requests and responses of the OAuth dance.public OAuthDancerBuilder responseAccessTokenExpr(String responseAccessTokenExpr)
responseAccessTokenExpr in interface OAuthDancerBuilder<D>responseAccessTokenExpr - an expression to extract the access token parameter from the response of the call to
token-url.public OAuthDancerBuilder responseRefreshTokenExpr(String responseRefreshTokenExpr)
responseRefreshTokenExpr in interface OAuthDancerBuilder<D>responseRefreshTokenExpr - an expression to extract the refresh token parameter from the response of the call to
token-url.public OAuthDancerBuilder responseExpiresInExpr(String responseExpiresInExpr)
responseExpiresInExpr in interface OAuthDancerBuilder<D>responseExpiresInExpr - an expression to extract the expiresIn parameter from the response of the call to
token-url.public OAuthDancerBuilder customParametersExtractorsExprs(Map<String,String> customParamsExtractorsExprs)
customParametersExtractorsExprs in interface OAuthDancerBuilder<D>customParamsExtractorsExprs - a map of paramName to an expression to extract the custom parameters from the
response of the call to token-url.public OAuthDancerBuilder<D> resourceOwnerIdTransformer(Function<String,String> resourceOwnerIdTransformer)
OAuthDancerBuildertokensStore and reuse it among different dancers, as long as each dancer has its own proper
resourceOwnerIdStoreTransformer and ensures there can be no collissions between the transformed
resourceOwnerIds for different dancers.
Providing this transformer only affects how the dancer puts the contexts associated to a reosurceOwner in the
tokensStore and the name of the locks generated from the lockProvider The un-transformed value still has to
be used when calling dancer methods that receive the resourceOwnerId as a parameter, and will be used when sending
data out as part of the OAuth dance or the token refresh.
resourceOwnerIdTransformer in interface OAuthDancerBuilder<D>resourceOwnerIdTransformer - a transformer to apply to the resourceOwnerId before using it to access the
provided tokensStore.Copyright © 2024. All rights reserved.