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 String |
clientId |
protected String |
clientSecret |
protected Map<String,String> |
customParametersExtractorsExprs |
protected Charset |
encoding |
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 clientId,
String clientSecret,
String tokenUrl,
Charset encoding,
String scopes,
String responseAccessTokenExpr,
String responseRefreshTokenExpr,
String responseExpiresInExpr,
Map<String,String> customParametersExtractorsExprs,
Function<String,String> resourceOwnerIdTransformer,
org.mule.runtime.api.lock.LockFactory lockProvider,
Map<String,org.mule.runtime.oauth.api.state.DefaultResourceOwnerOAuthContext> tokensStore,
org.mule.runtime.http.api.client.HttpClient httpClient,
org.mule.runtime.api.el.MuleExpressionLanguage expressionEvaluator) |
| Modifier and Type | Method and Description |
|---|---|
org.mule.runtime.oauth.api.state.ResourceOwnerOAuthContext |
getContextForResourceOwner(String resourceOwnerId)
Retrieves the oauth context for a particular user.
|
void |
invalidateContext(String resourceOwner) |
protected TokenResponse |
invokeTokenUrl(String tokenUrl,
Map<String,String> tokenRequestFormToSend,
String authorization,
boolean retrieveRefreshToken,
Charset encoding) |
protected <T> T |
resolveExpression(String expr,
Object body,
org.mule.runtime.http.api.domain.ParameterMap headers,
org.mule.runtime.api.metadata.MediaType responseContentType) |
protected <T> T |
resolveExpression(String expr,
Object body,
org.mule.runtime.http.api.domain.ParameterMap headers,
org.mule.runtime.http.api.domain.ParameterMap queryParams,
org.mule.runtime.api.metadata.MediaType responseContentType) |
void |
start() |
void |
stop() |
protected void |
updateResourceOwnerOAuthContext(org.mule.runtime.oauth.api.state.DefaultResourceOwnerOAuthContext resourceOwnerOAuthContext)
Updates the resource owner oauth context information
|
protected final String clientId
protected final String clientSecret
protected final String tokenUrl
protected final Charset encoding
protected final String scopes
protected final String responseAccessTokenExpr
protected final String responseRefreshTokenExpr
protected final String responseExpiresInExpr
protected AbstractOAuthDancer(String clientId, String clientSecret, String tokenUrl, Charset encoding, String scopes, String responseAccessTokenExpr, String responseRefreshTokenExpr, String responseExpiresInExpr, Map<String,String> customParametersExtractorsExprs, Function<String,String> resourceOwnerIdTransformer, org.mule.runtime.api.lock.LockFactory lockProvider, Map<String,org.mule.runtime.oauth.api.state.DefaultResourceOwnerOAuthContext> tokensStore, org.mule.runtime.http.api.client.HttpClient httpClient, org.mule.runtime.api.el.MuleExpressionLanguage expressionEvaluator)
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 TokenResponse invokeTokenUrl(String tokenUrl, Map<String,String> tokenRequestFormToSend, String authorization, boolean retrieveRefreshToken, Charset encoding) throws org.mule.runtime.oauth.api.exception.TokenUrlResponseException, org.mule.runtime.oauth.api.exception.TokenNotFoundException
org.mule.runtime.oauth.api.exception.TokenUrlResponseExceptionorg.mule.runtime.oauth.api.exception.TokenNotFoundExceptionprotected <T> T resolveExpression(String expr, Object body, org.mule.runtime.http.api.domain.ParameterMap headers, org.mule.runtime.api.metadata.MediaType responseContentType)
protected <T> T resolveExpression(String expr, Object body, org.mule.runtime.http.api.domain.ParameterMap headers, org.mule.runtime.http.api.domain.ParameterMap 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.DefaultResourceOwnerOAuthContext resourceOwnerOAuthContext)
resourceOwnerOAuthContext - Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.