public class ClientCredentialsGrantType extends AbstractGrantType implements Initialisable, Startable, MuleContextAware
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
ClientCredentialsGrantType() |
Modifier and Type | Method and Description |
---|---|
void |
authenticate(MuleEvent muleEvent,
HttpRequestBuilder builder)
Adds authentication information to the request.
|
String |
getClientId() |
String |
getClientSecret() |
String |
getRefreshTokenWhen() |
TlsContextFactory |
getTlsContext() |
void |
initialise()
Method used to perform any initialisation work.
|
void |
refreshAccessToken() |
void |
setClientId(String clientId) |
void |
setClientSecret(String clientSecret) |
void |
setMuleContext(MuleContext context) |
void |
setTlsContext(TlsContextFactory tlsContextFactory) |
void |
setTokenManager(TokenManagerConfig tokenManager) |
void |
setTokenRequestHandler(ClientCredentialsTokenRequestHandler tokenRequestHandler) |
boolean |
shouldRetry(MuleEvent firstAttemptResponseEvent)
Detects if there was an authentication failure in the response.
|
void |
start() |
buildAuthorizationHeaderContent
public void setClientId(String clientId)
public void setClientSecret(String clientSecret)
public void setTokenRequestHandler(ClientCredentialsTokenRequestHandler tokenRequestHandler)
public TlsContextFactory getTlsContext()
public void setTlsContext(TlsContextFactory tlsContextFactory)
public void start() throws MuleException
start
in interface Startable
MuleException
public String getClientSecret()
getClientSecret
in interface ApplicationCredentials
public String getClientId()
getClientId
in interface ApplicationCredentials
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 setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
public String getRefreshTokenWhen()
public void refreshAccessToken() throws MuleException
MuleException
public 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)
HttpAuthentication
shouldRetry
in interface HttpAuthentication
firstAttemptResponseEvent
- The event with the response of the request.public void setTokenManager(TokenManagerConfig tokenManager)
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.