Interface AuthorizationCodeOAuthDancer


  • @NoImplement
    public interface AuthorizationCodeOAuthDancer
    Implementations provide OAuth dance support for authorization-code grant-type.
    Since:
    1.0
    • Method Detail

      • refreshToken

        CompletableFuture<Void> refreshToken​(String resourceOwner)
        Performs the refresh of the access token.
        Parameters:
        resourceOwner - The resource owner to get the token for.
        Returns:
        a completable future that is complete when the token has been refreshed.
      • refreshToken

        default CompletableFuture<Void> refreshToken​(String resourceOwner,
                                                     boolean useQueryParameters)
        Performs the refresh of the access token.
        Parameters:
        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.
        Returns:
        a completable future that is complete when the token has been refreshed.
      • invalidateContext

        void invalidateContext​(String resourceOwnerId)
        Clears the oauth context for a given user.
        Parameters:
        resourceOwnerId - id of the user.
      • getContextForResourceOwner

        ResourceOwnerOAuthContext getContextForResourceOwner​(String resourceOwnerId)
        Retrieves the oauth context for a particular user. If there's no state for that user a new state is retrieved so never returns null.
        Parameters:
        resourceOwnerId - id of the user.
        Returns:
        oauth state
      • handleLocalAuthorizationRequest

        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.
        Parameters:
        request - the request from the user to login and/or authorize the application
        responseCallback - the callback where the response with the redirection to the login/authorization page will be sent