public class DefaultAuthorizationCodeGrantType extends AbstractGrantType implements Initialisable, AuthorizationCodeGrantType, Startable, MuleContextAware
Modifier and Type | Field and Description |
---|---|
static String |
EXTERNAL_REDIRECT_URL_PROPERTY |
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
DefaultAuthorizationCodeGrantType() |
Modifier and Type | Method and Description |
---|---|
void |
authenticate(MuleEvent muleEvent,
HttpRequestBuilder builder)
Adds authentication information to the request.
|
String |
getClientId() |
String |
getClientSecret() |
ConfigOAuthContext |
getConfigOAuthContext() |
String |
getExternalRedirectionUrl() |
AttributeEvaluator |
getLocalAuthorizationUrlResourceOwnerIdEvaluator() |
String |
getRedirectionUrl() |
String |
getRefreshTokenWhen() |
AttributeEvaluator |
getResourceOwnerIdEvaluator() |
org.mule.transport.ssl.api.TlsContextFactory |
getTlsContext() |
ConfigOAuthContext |
getUserOAuthContext() |
void |
initialise()
Method used to perform any initialisation work.
|
void |
refreshToken(MuleEvent currentFlowEvent,
String resourceOwnerId)
Does a refresh token for a particular oauth context id.
|
void |
setAuthorizationRequestHandler(AuthorizationRequestHandler authorizationRequestHandler) |
void |
setClientId(String clientId) |
void |
setClientSecret(String clientSecret) |
void |
setExternalRedirectionUrl(String externalRedirectionUrl) |
void |
setLocalAuthorizationUrlResourceOwnerId(String resourceOwnerId) |
void |
setMuleContext(MuleContext context) |
void |
setRedirectionUrl(String redirectionUrl) |
void |
setResourceOwnerId(String resourceOwnerId) |
void |
setTlsContext(org.mule.transport.ssl.api.TlsContextFactory tlsContextFactory) |
void |
setTokenManager(TokenManagerConfig tokenManagerConfig) |
void |
setTokenRequestHandler(AbstractAuthorizationCodeTokenRequestHandler tokenRequestHandler) |
boolean |
shouldRetry(MuleEvent firstAttemptResponseEvent)
Detects if there was an authentication failure in the response.
|
void |
start() |
buildAuthorizationHeaderContent
public static final String EXTERNAL_REDIRECT_URL_PROPERTY
public void setClientId(String clientId)
public void setClientSecret(String clientSecret)
public void setRedirectionUrl(String redirectionUrl)
public void setExternalRedirectionUrl(String externalRedirectionUrl)
public void setAuthorizationRequestHandler(AuthorizationRequestHandler authorizationRequestHandler)
public void setTokenRequestHandler(AbstractAuthorizationCodeTokenRequestHandler tokenRequestHandler)
public ConfigOAuthContext getConfigOAuthContext()
public String getRedirectionUrl()
getRedirectionUrl
in interface AuthorizationCodeGrantType
public String getExternalRedirectionUrl()
getExternalRedirectionUrl
in interface AuthorizationCodeGrantType
public String getRefreshTokenWhen()
getRefreshTokenWhen
in interface AuthorizationCodeGrantType
public AttributeEvaluator getLocalAuthorizationUrlResourceOwnerIdEvaluator()
getLocalAuthorizationUrlResourceOwnerIdEvaluator
in interface AuthorizationCodeGrantType
public AttributeEvaluator getResourceOwnerIdEvaluator()
getResourceOwnerIdEvaluator
in interface AuthorizationCodeGrantType
public void refreshToken(MuleEvent currentFlowEvent, String resourceOwnerId) throws MuleException
AuthorizationCodeGrantType
refreshToken
in interface AuthorizationCodeGrantType
currentFlowEvent
- event from the flow that requires a new access token.resourceOwnerId
- the id of the oauth context to refresh.MuleException
public ConfigOAuthContext getUserOAuthContext()
getUserOAuthContext
in interface AuthorizationCodeGrantType
public String getClientSecret()
getClientSecret
in interface ApplicationCredentials
public String getClientId()
getClientId
in interface ApplicationCredentials
public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
public org.mule.transport.ssl.api.TlsContextFactory getTlsContext()
getTlsContext
in interface AuthorizationCodeGrantType
public void setTlsContext(org.mule.transport.ssl.api.TlsContextFactory tlsContextFactory)
public void initialise() throws InitialisationException
Initialisable
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered frompublic void authenticate(MuleEvent muleEvent, HttpRequestBuilder builder) throws MuleException
HttpAuthentication
authenticate
in interface HttpAuthentication
muleEvent
- The event that is being processed.builder
- The builder that is being used to create the HTTP request.MuleException
public boolean shouldRetry(MuleEvent firstAttemptResponseEvent) throws MuleException
HttpAuthentication
shouldRetry
in interface HttpAuthentication
firstAttemptResponseEvent
- The event with the response of the request.MuleException
public void setLocalAuthorizationUrlResourceOwnerId(String resourceOwnerId)
public void setResourceOwnerId(String resourceOwnerId)
public void setTokenManager(TokenManagerConfig tokenManagerConfig)
public void start() throws MuleException
start
in interface Startable
MuleException
Copyright © 2003–2018 MuleSoft, Inc.. All rights reserved.