Interface RemoteAPITokenService

  • All Known Implementing Classes:
    RemoteAPITokenServiceImpl

    public interface RemoteAPITokenService
    Service for saving and reading tokens for Remote APIs
    • Method Detail

      • create

        RemoteAPIToken create​(RemoteAPIToken token)
        Add a token to the store for a given service
        Parameters:
        token - The token to create
        Returns:
        the created token
      • createTokenFromAuthCode

        RemoteAPIToken createTokenFromAuthCode​(java.lang.String authcode,
                                               RemoteAPI remoteAPI,
                                               java.lang.String tokenRedirect)
                                        throws org.apache.oltu.oauth2.common.exception.OAuthSystemException,
                                               org.apache.oltu.oauth2.common.exception.OAuthProblemException
        Create a new RemoteAPIToken from a given auth code
        Parameters:
        authcode - the auth code to create a token for
        remoteAPI - the remote api to get a token for
        tokenRedirect - a redirect url to get the token from
        Returns:
        the newly created token
        Throws:
        org.apache.oltu.oauth2.common.exception.OAuthSystemException - If ther's a problem building the token request
        org.apache.oltu.oauth2.common.exception.OAuthProblemException - If there's a problem with the token request
      • updateTokenFromRefreshToken

        RemoteAPIToken updateTokenFromRefreshToken​(RemoteAPI api)
        Update a given RemoteAPI's OAuth token by refresh token if available
        Parameters:
        api - the API to update
        Returns:
        the most recent token if available