@NoImplement
public interface AuthorizationCodeOAuthDancer
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<String> |
accessToken(String resourceOwner)
Will query the internal state (the
tokensStore parameter passed to the service to build the
AuthorizationCodeOAuthDancer) to get the appropriate accessToken. |
void |
addListener(AuthorizationCodeListener listener)
Adds the
listener. |
ResourceOwnerOAuthContext |
getContextForResourceOwner(String resourceOwnerId)
Retrieves the oauth context for a particular user.
|
void |
handleLocalAuthorizationRequest(org.mule.runtime.http.api.domain.message.request.HttpRequest request,
org.mule.runtime.http.api.server.async.HttpResponseReadyCallback responseCallback)
Handles an http request that will redirect to the access page in
authorizationUrl with the configured credentials. |
void |
invalidateContext(String resourceOwnerId)
Clears the oauth context for a given user.
|
CompletableFuture<Void> |
refreshToken(String resourceOwner)
Performs the refresh of the access token.
|
default CompletableFuture<Void> |
refreshToken(String resourceOwner,
boolean useQueryParameters)
Performs the refresh of the access token.
|
void |
removeListener(AuthorizationCodeListener listener)
Removes the
listener. |
CompletableFuture<String> accessToken(String resourceOwner) throws RequestAuthenticationException
tokensStore parameter passed to the service to build the
AuthorizationCodeOAuthDancer) to get the appropriate accessToken. This requires that the authorization has been
performed beforehand, otherwise, a RequestAuthenticationException will be thrown.resourceOwner - The resource owner to get the token for.RequestAuthenticationException - if called for a resourceOwner that has not yet been authorized.CompletableFuture<Void> refreshToken(String resourceOwner)
resourceOwner - The resource owner to get the token for.default CompletableFuture<Void> refreshToken(String resourceOwner, boolean useQueryParameters)
resourceOwner - The resource owner to get the token for.useQueryParameters - If the parameters needed to refresh the token should be sent as query parameters. If false, they
will be sent encoded in the body of the message.void invalidateContext(String resourceOwnerId)
resourceOwnerId - id of the user.ResourceOwnerOAuthContext getContextForResourceOwner(String resourceOwnerId)
resourceOwnerId - id of the user.void handleLocalAuthorizationRequest(org.mule.runtime.http.api.domain.message.request.HttpRequest request,
org.mule.runtime.http.api.server.async.HttpResponseReadyCallback responseCallback)
authorizationUrl with the configured credentials.request - the request from the user to login and/or authorize the applicationresponseCallback - the callback where the response with the redirection to the login/authorization page will be sentvoid addListener(AuthorizationCodeListener listener)
listener. Listeners will be invoked in the same order as they were addedlistener - the AuthorizationCodeListener to be addedIllegalArgumentException - if the listener is nullvoid removeListener(AuthorizationCodeListener listener)
listener. Nothing happens if it wasn't part of this dancer.listener - the AuthorizationCodeListener to be removedIllegalArgumentException - if the listener is nullCopyright © 2022. All rights reserved.