Interface ResourceOwnerOAuthContext

  • All Known Implementing Classes:
    ResourceOwnerOAuthContextWithRefreshState

    @NoImplement
    public interface ResourceOwnerOAuthContext
    OAuth state for a particular resource owner, which typically represents an user.
    Since:
    1.0
    • Method Detail

      • getAccessToken

        String getAccessToken()
        Returns:
        access token of the oauth context retrieved by the token request
      • getRefreshToken

        String getRefreshToken()
        Returns:
        refresh token of the oauth context retrieved by the token request
      • getState

        String getState()
        Returns:
        state of the oauth context send in the authorization request
      • getExpiresIn

        String getExpiresIn()
        Returns:
        expires in value retrieved by the token request.
      • getTokenResponseParameters

        Map<String,​Object> getTokenResponseParameters()
        Returns:
        custom token request response parameters configured for extraction.
      • getResourceOwnerId

        String getResourceOwnerId()
        Returns:
        id for the oauth state.
      • getDancerState

        DancerState getDancerState()
        Returns:
        the state of the dance for the resource owner of this context.
      • setDancerState

        void setDancerState​(DancerState dancerState)
        Updates the state of the dancer for this context.

        Note that calling this just updates the internal state of this object. Calling this method does not persist this change in any store. That has to be done explicitly after calling this method.

        Parameters:
        dancerState - the state of the dance for the resource owner of this context.
      • getRefreshOAuthContextLock

        Lock getRefreshOAuthContextLock​(String lockNamePrefix,
                                        org.mule.runtime.api.lock.LockFactory lockFactory)
        Obtains a lock to avoid triggering a refresh of the context more than once simultaneously.
        Parameters:
        lockNamePrefix - a prefix to uniquely identify the locks in the provided lockFactory.
        lockFactory - the object to get the locks from. This will ensure that the same lock instance is used after serialization/deserialization of this context.
        Returns:
        a lock that can be used to avoid concurrency problems trying to update oauth context.