@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)
Deprecated.
since 1.1, 1.0.2. Use
addListener(String, AuthorizationCodeListener) instead to properly handle the
events corresponding to a resource owner |
default void |
addListener(String resourceOwnerId,
AuthorizationCodeListener listener)
Adds the
listener. |
ResourceOwnerOAuthContext |
getContextForResourceOwner(String resourceOwnerId)
Retrieves the oauth context for a particular user.
|
boolean |
getInvalidateFromTokensStore(String resourceOwner)
Retrieve ResourceOwnerOAuthContext from tokensStore to check invalidation status of a token.
|
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.
|
void |
invalidateContext(String resourceOwnerId,
boolean forceInvalidateStatusRetrieval)
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)
Deprecated.
since 1.1, 1.0.2. Use
addListener(String, AuthorizationCodeListener) instead |
default void |
removeListener(String resourceOwnerId,
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.void invalidateContext(String resourceOwnerId, boolean forceInvalidateStatusRetrieval)
resourceOwnerId - ID of the user.forceInvalidateStatusRetrieval - specifies whether the current token status should be forcefully invalidated and
retrieved again. If set to true, the system will disregard any cached status and
perform a fresh check of the token status.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 sent@Deprecated void addListener(AuthorizationCodeListener listener)
addListener(String, AuthorizationCodeListener) instead to properly handle the
events corresponding to a resource ownerlistener. Listeners will be invoked in the same order as they were addedlistener - the AuthorizationCodeListener to be addedIllegalArgumentException - if the listener is null@Deprecated void removeListener(AuthorizationCodeListener listener)
addListener(String, AuthorizationCodeListener) insteadlistener. Nothing happens if it wasn't part of this dancer.listener - the AuthorizationCodeListener to be removedIllegalArgumentException - if the listener is nulldefault void addListener(String resourceOwnerId, AuthorizationCodeListener listener)
listener. Listeners will be invoked in the same order as they were addedresourceOwnerId - id of the user who the listener corresponds tolistener - the AuthorizationCodeListener to be addedIllegalArgumentException - if the listener is nulldefault void removeListener(String resourceOwnerId, AuthorizationCodeListener listener)
listener. Nothing happens if it wasn't part of this dancer.resourceOwnerId - id of the user who the listener corresponds tolistener - the AuthorizationCodeListener to be removedIllegalArgumentException - if the listener is nullboolean getInvalidateFromTokensStore(String resourceOwner)
resourceOwner - resourceOwner id that is used as keyCopyright © 2024. All rights reserved.