public interface OAuthClient
Modifier and Type | Method and Description |
---|---|
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.
|
Promise<? extends SessionInfo,OAuthException> |
getSessionInfo(DataStore dataStore)
Validate whether an Auth Server session is still active and valid.
|
Promise<UserInfo,OAuthException> |
getUserInfo(DataStore dataStore)
Return the authenticated user's info from the external authentication server.
|
Promise<JsonValue,OAuthException> |
handlePostAuth(DataStore dataStore,
Map<String,List<String>> requestParameters)
Handle the data produced by the Auth Server as a result of a successful authentication and return the final
redirect to the landing page specified in the
OAuthClient.getAuthRedirect(DataStore, String, URI) call. |
Promise<Void,OAuthException> |
refresh(DataStore dataStore)
Refreshes a token if it has expired.
|
Promise<URI,OAuthException> getAuthRedirect(DataStore dataStore, String data, URI landingPage)
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.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.Promise<JsonValue,OAuthException> handlePostAuth(DataStore dataStore, Map<String,List<String>> requestParameters)
OAuthClient.getAuthRedirect(DataStore, String, URI)
call.
Validate the request as secure. The returned JsonValue
response will also contain the data passed to
OAuthClient.getAuthRedirect(DataStore, String, URI)
.dataStore
- The data store that contains information about the OAuth interaction.requestParameters
- The request parameters containing the data produced by the external
authentication server.Promise
, with a type of JsonValue
, containing the landing page and the data value
that was stored in the data store during the OAuthClient.getAuthRedirect(DataStore, String, URI)
call; Promise
, with a type of OAuthException
, when an error occurs.Promise<? extends SessionInfo,OAuthException> getSessionInfo(DataStore dataStore)
Promise<UserInfo,OAuthException> getUserInfo(DataStore dataStore)
Promise<Void,OAuthException> refresh(DataStore dataStore)
dataStore
- The data store that contains information about the OAuth interaction.Promise
If a new token has been retrieved, update the data store with the new token.
OAuthException
when an error occurs.Copyright © 2010-2018, ForgeRock All Rights Reserved.