public class DefaultClientCredentialsOAuthDancer extends AbstractOAuthDancer<DefaultClientCredentialsOAuthDancerConfig> implements ClientCredentialsOAuthDancer
config, TOKEN_REQUEST_TIMEOUT_MILLIS| Constructor and Description |
|---|
DefaultClientCredentialsOAuthDancer(DefaultClientCredentialsOAuthDancerConfig config) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<String> |
accessToken()
Will query the internal state (the
tokensStore parameter passed to the service to build the
ClientCredentialsOAuthDancer) to get the appropriate accessToken. |
void |
addListener(ClientCredentialsListener listener)
Adds the
listener. |
ResourceOwnerOAuthContext |
getContext()
Retrieves the oauth context.
|
void |
invalidateContext()
Clears the oauth context.
|
CompletableFuture<Void> |
refreshToken()
Performs the refresh of the access token.
|
void |
removeListener(ClientCredentialsListener listener)
Removes the
listener. |
void |
start() |
doAddListener, doRefreshToken, doRefreshTokenRequest, doRemoveListener, getContextForResourceOwner, getInvalidateFromTokensStore, getListenersToNotifyInvalidation, getLockProvider, handleClientCredentials, invalidateContext, invalidateContext, invokeTokenUrl, onEachListener, onEachListener, parseTokenResponse, resolveExpression, resolveExpression, startHttpClient, stop, stopHttpClient, tokenUrlExceptionHandler, updateOAuthContextAfterTokenResponse, updateResourceOwnerOAuthContextpublic DefaultClientCredentialsOAuthDancer(DefaultClientCredentialsOAuthDancerConfig config)
public void start()
throws org.mule.runtime.api.exception.MuleException
start in interface org.mule.runtime.api.lifecycle.Startablestart in class AbstractOAuthDancer<DefaultClientCredentialsOAuthDancerConfig>org.mule.runtime.api.exception.MuleExceptionpublic CompletableFuture<String> accessToken() throws RequestAuthenticationException
ClientCredentialsOAuthDancertokensStore parameter passed to the service to build the
ClientCredentialsOAuthDancer) to get the appropriate accessToken. This requires that the authorization has been
performed beforehand, otherwise, a RequestAuthenticationException will be thrown.accessToken in interface ClientCredentialsOAuthDancerRequestAuthenticationException - if called for a resourceOwner that has not yet been authorized.public CompletableFuture<Void> refreshToken()
ClientCredentialsOAuthDancerrefreshToken in interface ClientCredentialsOAuthDancerpublic void addListener(ClientCredentialsListener listener)
ClientCredentialsOAuthDancerlistener. Listeners will be invoked in the same order as they were addedaddListener in interface ClientCredentialsOAuthDancerlistener - the ClientCredentialsListener to be addedpublic void removeListener(ClientCredentialsListener listener)
ClientCredentialsOAuthDancerlistener. Nothing happens if it wasn't part of this dancer.removeListener in interface ClientCredentialsOAuthDancerlistener - the ClientCredentialsListener to be removedpublic void invalidateContext()
ClientCredentialsOAuthDancerinvalidateContext in interface ClientCredentialsOAuthDancerpublic ResourceOwnerOAuthContext getContext()
ClientCredentialsOAuthDancergetContext in interface ClientCredentialsOAuthDancerCopyright © 2024. All rights reserved.