Class DefaultAuthorizationCodeOAuthDancer

  • All Implemented Interfaces:
    org.mule.oauth.client.api.AuthorizationCodeOAuthDancer, org.mule.runtime.api.lifecycle.Disposable, org.mule.runtime.api.lifecycle.Initialisable, org.mule.runtime.api.lifecycle.Lifecycle, org.mule.runtime.api.lifecycle.Startable, org.mule.runtime.api.lifecycle.Stoppable

    public class DefaultAuthorizationCodeOAuthDancer
    extends AbstractOAuthDancer<DefaultAuthorizationCodeOAuthDancerConfig>
    implements org.mule.oauth.client.api.AuthorizationCodeOAuthDancer, org.mule.runtime.api.lifecycle.Lifecycle
    Provides OAuth dance support for authorization-code grant-type.
    Since:
    1.0
    • Method Detail

      • initialise

        public void initialise()
                        throws org.mule.runtime.api.lifecycle.InitialisationException
        Specified by:
        initialise in interface org.mule.runtime.api.lifecycle.Initialisable
        Throws:
        org.mule.runtime.api.lifecycle.InitialisationException
      • addListener

        public void addListener​(org.mule.oauth.client.api.listener.AuthorizationCodeListener listener)
        Specified by:
        addListener in interface org.mule.oauth.client.api.AuthorizationCodeOAuthDancer
      • removeListener

        public void removeListener​(org.mule.oauth.client.api.listener.AuthorizationCodeListener listener)
        Specified by:
        removeListener in interface org.mule.oauth.client.api.AuthorizationCodeOAuthDancer
      • addListener

        public void addListener​(String resourceOwnerId,
                                org.mule.oauth.client.api.listener.AuthorizationCodeListener listener)
        Specified by:
        addListener in interface org.mule.oauth.client.api.AuthorizationCodeOAuthDancer
      • removeListener

        public void removeListener​(String resourceOwnerId,
                                   org.mule.oauth.client.api.listener.AuthorizationCodeListener listener)
        Specified by:
        removeListener in interface org.mule.oauth.client.api.AuthorizationCodeOAuthDancer
      • handleLocalAuthorizationRequest

        public void handleLocalAuthorizationRequest​(org.mule.runtime.http.api.domain.message.request.HttpRequest request,
                                                    org.mule.runtime.http.api.server.async.HttpResponseReadyCallback responseCallback)
        Specified by:
        handleLocalAuthorizationRequest in interface org.mule.oauth.client.api.AuthorizationCodeOAuthDancer
      • dispose

        public void dispose()
        Specified by:
        dispose in interface org.mule.runtime.api.lifecycle.Disposable
      • accessToken

        public CompletableFuture<String> accessToken​(String resourceOwner)
                                              throws org.mule.oauth.client.api.exception.RequestAuthenticationException
        Specified by:
        accessToken in interface org.mule.oauth.client.api.AuthorizationCodeOAuthDancer
        Throws:
        org.mule.oauth.client.api.exception.RequestAuthenticationException
      • refreshToken

        public CompletableFuture<Void> refreshToken​(String resourceOwner)
        Specified by:
        refreshToken in interface org.mule.oauth.client.api.AuthorizationCodeOAuthDancer
      • refreshToken

        public CompletableFuture<Void> refreshToken​(String resourceOwner,
                                                    boolean useQueryParameters)
        Specified by:
        refreshToken in interface org.mule.oauth.client.api.AuthorizationCodeOAuthDancer
      • doRefreshTokenRequest

        protected CompletableFuture<Void> doRefreshTokenRequest​(boolean useQueryParameters,
                                                                org.mule.oauth.client.api.state.ResourceOwnerOAuthContextWithRefreshState resourceOwnerOAuthContext)
      • getListenersToNotifyInvalidation

        protected List<? extends org.mule.oauth.client.api.listener.OAuthStateListener> getListenersToNotifyInvalidation​(org.mule.oauth.client.api.state.ResourceOwnerOAuthContext resourceOwnerOAuthContext)
        Retrieves all the listeners that should be notified of a token invalidation event, i.e. the ones registered associated to the given resource owner in an explicit way and the ones that were registered in a general way (without indicating the resource owner) in order not to break backward compatibility.
        Overrides:
        getListenersToNotifyInvalidation in class AbstractOAuthDancer<DefaultAuthorizationCodeOAuthDancerConfig>
        Parameters:
        resourceOwnerOAuthContext - context
        Returns:
        the listeners to be notified of the token invalidation event.