Interface OAuthClient

    • Method Detail

      • getAuthRedirect

        Promise<URI,​OAuthException> getAuthRedirect​(DataStore dataStore,
                                                          String data,
                                                          URI landingPage)
        Return the URI that the user agent should be redirected to, to authenticate and authorize access.
        Parameters:
        dataStore - The data store that contains information about the OAuth interaction.
        data - A value which will be stored in the data store to be returned as part of the final landing page redirect response, this MUST be URI safe.
        landingPage - The final page a user agent should be sent following successful authentication.
        Returns:
        Promise, with a type of URI, suitable for redirecting the user agent for external authentication and authorization and an Promise, with a type of OAuthException, when an error occurs.
      • getSessionInfo

        Promise<? extends SessionInfo,​OAuthException> getSessionInfo​(DataStore dataStore)
        Validate whether an Auth Server session is still active and valid.
        Parameters:
        dataStore - The data store that contains information about the OAuth interaction.
        Returns:
        Promise, with a type of SessionInfo, representing information about the session. Promise, with a type of OAuthException, when an error occurs.
      • getUserInfo

        Promise<UserInfo,​OAuthException> getUserInfo​(DataStore dataStore)
        Return the authenticated user's info from the external authentication server.
        Parameters:
        dataStore - The data store that contains information about the OAuth interaction.
        Returns:
        Promise, with a type of UserInfo, containing the available user info. Promise, with a type of OAuthException, when an error occurs.
      • refresh

        Promise<Void,​OAuthException> refresh​(DataStore dataStore)
        Refreshes a token if it has expired.
        Parameters:
        dataStore - The data store that contains information about the OAuth interaction.
        Returns:
        Promise If a new token has been retrieved, update the data store with the new token. OAuthException when an error occurs.