public abstract class AbstractOAuthDancer extends Object implements org.mule.runtime.api.lifecycle.Startable, org.mule.runtime.api.lifecycle.Stoppable
| Modifier and Type | Field and Description |
|---|---|
protected org.mule.runtime.oauth.api.builder.ClientCredentialsLocation |
clientCredentialsLocation |
protected String |
clientId |
protected String |
clientSecret |
protected Map<String,String> |
customParametersExtractorsExprs |
protected Charset |
encoding |
protected String |
name |
protected Function<String,String> |
resourceOwnerIdTransformer |
protected String |
responseAccessTokenExpr |
protected String |
responseExpiresInExpr |
protected String |
responseRefreshTokenExpr |
protected String |
scopes |
protected String |
tokenUrl |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractOAuthDancer(String name,
String clientId,
String clientSecret,
String tokenUrl,
Charset encoding,
String scopes,
org.mule.runtime.oauth.api.builder.ClientCredentialsLocation clientCredentialsLocation,
String responseAccessTokenExpr,
String responseRefreshTokenExpr,
String responseExpiresInExpr,
Map<String,String> customParametersExtractorsExprs,
Function<String,String> resourceOwnerIdTransformer,
org.mule.runtime.api.scheduler.SchedulerService schedulerService,
org.mule.runtime.api.lock.LockFactory lockProvider,
Map<String,org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext> tokensStore,
org.mule.runtime.http.api.client.HttpClient httpClient,
org.mule.runtime.api.el.MuleExpressionLanguage expressionEvaluator)
|
protected |
AbstractOAuthDancer(String name,
String clientId,
String clientSecret,
String tokenUrl,
Charset encoding,
String scopes,
org.mule.runtime.oauth.api.builder.ClientCredentialsLocation clientCredentialsLocation,
String responseAccessTokenExpr,
String responseRefreshTokenExpr,
String responseExpiresInExpr,
Map<String,String> customParametersExtractorsExprs,
Function<String,String> resourceOwnerIdTransformer,
org.mule.runtime.api.scheduler.SchedulerService schedulerService,
org.mule.runtime.api.lock.LockFactory lockProvider,
Map<String,org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext> tokensStore,
org.mule.runtime.http.api.client.HttpClient httpClient,
org.mule.runtime.api.el.MuleExpressionLanguage expressionEvaluator,
List<? extends org.mule.runtime.oauth.api.listener.OAuthStateListener> listeners) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doAddListener(org.mule.runtime.oauth.api.listener.OAuthStateListener listener) |
protected CompletableFuture<Void> |
doRefreshToken(Supplier<org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext> oauthContextSupplier,
Function<org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext,CompletableFuture<Void>> tokenRefreshRequester)
Method for refreshing tokens in a thread-safe manner across nodes of a cluster.
|
protected CompletableFuture<Void> |
doRefreshTokenRequest(Function<org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext,CompletableFuture<Void>> tokenRefreshRequester,
org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext oauthContext) |
protected void |
doRemoveListener(org.mule.runtime.oauth.api.listener.OAuthStateListener listener) |
org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext |
getContextForResourceOwner(String resourceOwnerId)
Retrieves the oauth context for a particular user.
|
protected org.mule.runtime.api.lock.LockFactory |
getLockProvider() |
protected String |
handleClientCredentials(Map<String,String> formData)
Based on the value of
clientCredentialsLocation, add the clientId and clientSecret values to the form or encode and
return them. |
void |
invalidateContext(String resourceOwner) |
protected CompletableFuture<TokenResponse> |
invokeTokenUrl(String tokenUrl,
Map<String,String> tokenRequestFormToSend,
org.mule.runtime.api.util.MultiMap<String,String> queryParams,
org.mule.runtime.api.util.MultiMap<String,String> headers,
String authorization,
boolean retrieveRefreshToken,
Charset encoding) |
protected void |
onEachListener(Consumer<org.mule.runtime.oauth.api.listener.OAuthStateListener> action) |
protected <T> T |
resolveExpression(String expr,
Object body,
org.mule.runtime.api.util.MultiMap<String,String> headers,
org.mule.runtime.api.metadata.MediaType responseContentType) |
protected <T> T |
resolveExpression(String expr,
Object body,
org.mule.runtime.api.util.MultiMap<String,String> headers,
org.mule.runtime.api.util.MultiMap<String,String> queryParams,
org.mule.runtime.api.metadata.MediaType responseContentType) |
void |
start() |
void |
stop() |
protected Function<Throwable,? extends Void> |
tokenUrlExceptionHandler(org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext defaultUserState) |
protected void |
updateOAuthContextAfterTokenResponse(org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext defaultUserState) |
protected void |
updateResourceOwnerOAuthContext(org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext resourceOwnerOAuthContext)
Updates the resource owner oauth context information
|
protected final String name
protected final String clientId
protected final String clientSecret
protected final String tokenUrl
protected final Charset encoding
protected final String scopes
protected final org.mule.runtime.oauth.api.builder.ClientCredentialsLocation clientCredentialsLocation
protected final String responseAccessTokenExpr
protected final String responseRefreshTokenExpr
protected final String responseExpiresInExpr
@Deprecated protected AbstractOAuthDancer(String name, String clientId, String clientSecret, String tokenUrl, Charset encoding, String scopes, org.mule.runtime.oauth.api.builder.ClientCredentialsLocation clientCredentialsLocation, String responseAccessTokenExpr, String responseRefreshTokenExpr, String responseExpiresInExpr, Map<String,String> customParametersExtractorsExprs, Function<String,String> resourceOwnerIdTransformer, org.mule.runtime.api.scheduler.SchedulerService schedulerService, org.mule.runtime.api.lock.LockFactory lockProvider, Map<String,org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext> tokensStore, org.mule.runtime.http.api.client.HttpClient httpClient, org.mule.runtime.api.el.MuleExpressionLanguage expressionEvaluator)
protected AbstractOAuthDancer(String name, String clientId, String clientSecret, String tokenUrl, Charset encoding, String scopes, org.mule.runtime.oauth.api.builder.ClientCredentialsLocation clientCredentialsLocation, String responseAccessTokenExpr, String responseRefreshTokenExpr, String responseExpiresInExpr, Map<String,String> customParametersExtractorsExprs, Function<String,String> resourceOwnerIdTransformer, org.mule.runtime.api.scheduler.SchedulerService schedulerService, org.mule.runtime.api.lock.LockFactory lockProvider, Map<String,org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext> tokensStore, org.mule.runtime.http.api.client.HttpClient httpClient, org.mule.runtime.api.el.MuleExpressionLanguage expressionEvaluator, List<? extends org.mule.runtime.oauth.api.listener.OAuthStateListener> listeners)
public void start()
throws org.mule.runtime.api.exception.MuleException
start in interface org.mule.runtime.api.lifecycle.Startableorg.mule.runtime.api.exception.MuleExceptionpublic void stop()
throws org.mule.runtime.api.exception.MuleException
stop in interface org.mule.runtime.api.lifecycle.Stoppableorg.mule.runtime.api.exception.MuleExceptionprotected String handleClientCredentials(Map<String,String> formData)
clientCredentialsLocation, add the clientId and clientSecret values to the form or encode and
return them.formData - protected CompletableFuture<Void> doRefreshToken(Supplier<org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext> oauthContextSupplier, Function<org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext,CompletableFuture<Void>> tokenRefreshRequester)
protected CompletableFuture<Void> doRefreshTokenRequest(Function<org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext,CompletableFuture<Void>> tokenRefreshRequester, org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext oauthContext)
protected CompletableFuture<TokenResponse> invokeTokenUrl(String tokenUrl, Map<String,String> tokenRequestFormToSend, org.mule.runtime.api.util.MultiMap<String,String> queryParams, org.mule.runtime.api.util.MultiMap<String,String> headers, String authorization, boolean retrieveRefreshToken, Charset encoding)
protected void updateOAuthContextAfterTokenResponse(org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext defaultUserState)
protected Function<Throwable,? extends Void> tokenUrlExceptionHandler(org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext defaultUserState)
protected <T> T resolveExpression(String expr, Object body, org.mule.runtime.api.util.MultiMap<String,String> headers, org.mule.runtime.api.metadata.MediaType responseContentType)
protected <T> T resolveExpression(String expr, Object body, org.mule.runtime.api.util.MultiMap<String,String> headers, org.mule.runtime.api.util.MultiMap<String,String> queryParams, org.mule.runtime.api.metadata.MediaType responseContentType)
public void invalidateContext(String resourceOwner)
public org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext getContextForResourceOwner(String resourceOwnerId)
resourceOwnerId - id of the user.protected void updateResourceOwnerOAuthContext(org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext resourceOwnerOAuthContext)
resourceOwnerOAuthContext - protected org.mule.runtime.api.lock.LockFactory getLockProvider()
protected void doAddListener(org.mule.runtime.oauth.api.listener.OAuthStateListener listener)
protected void doRemoveListener(org.mule.runtime.oauth.api.listener.OAuthStateListener listener)
protected void onEachListener(Consumer<org.mule.runtime.oauth.api.listener.OAuthStateListener> action)
Copyright © 2003–2019 MuleSoft, Inc.. All rights reserved.