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.
      • handleNativePostAuth

        Promise<JsonValue,​OAuthException> handleNativePostAuth​(Context context,
                                                                     DataStore dataStore,
                                                                     Map<String,​List<String>> parameters)
        Handle the data produced by the Auth Server as a result of a successful authentication and return the final redirect to the mobile device. Validate the request as secure. The returned JsonValue response will also contain the data passed to getAuthRedirect(DataStore, String, URI).
        Parameters:
        context - Context chain used to keep a relationship between requests (tracking)
        dataStore - The data store that contains information about the OAuth interaction.
        parameters - The parameters containing the data sent by the external mobile device.
        Returns:
        Promise, with a type of JsonValue, containing the data value that was stored in the data store during the getAuthRedirect(DataStore, String, URI) call; 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.