Class AppleClient
- java.lang.Object
-
- org.forgerock.oauth.clients.oauth2.OAuth2Client<OpenIDConnectClientConfiguration>
-
- org.forgerock.oauth.clients.oidc.OpenIDConnectClient
-
- org.forgerock.oauth.clients.apple.AppleClient
-
- All Implemented Interfaces:
OAuthClient
public class AppleClient extends OpenIDConnectClient
Oauth 2.0 Client Implementation that supports Apple.
-
-
Field Summary
-
Fields inherited from class org.forgerock.oauth.clients.oidc.OpenIDConnectClient
ACR_VALUES, AUD, ID_TOKEN, NONCE, REQUEST, REQUEST_URI, SUB
-
Fields inherited from class org.forgerock.oauth.clients.oauth2.OAuth2Client
ACCEPT_HEADER, ACCESS_TOKEN, addExpireTime, APPLICATION_JSON, AUTHORIZATION_CODE, AUTHORIZATION_HEADER, BASIC_AUTH, BEARER_TOKEN, CLIENT_ID, CLIENT_SECRET, CODE, DATA, EXPIRE_TIME, EXPIRES_IN, GRANT_TYPE, HTTP_GET, HTTP_POST, httpHandler, LANDING_PAGE, PKCE_CODE_CHALLENGE, PKCE_CODE_CHALLENGE_METHOD, PKCE_CODE_VERIFIER, random, REDIRECT_URI, REFRESH_TOKEN, RESPONSE_TYPE, SCOPE, STATE, timeService, TOKEN, TOKEN_TYPE, TOKEN_TYPE_HINT
-
-
Constructor Summary
Constructors Constructor Description AppleClient(Handler httpHandler, AppleClientConfiguration config, Clock clock, SecureRandom random)
Constructs aAppleClient
.AppleClient(Handler httpHandler, OpenIDConnectClientConfiguration config, Clock clock, SecureRandom random, OpenIdResolverService resolverService, OpenIdResolverServiceConfigurator serviceConfigurator)
Constructs aAppleClient
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Form
buildQuery(String nonce)
Adds the response_mode to the request.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 theOAuthClient.getAuthRedirect(DataStore, String, URI)
call.-
Methods inherited from class org.forgerock.oauth.clients.oidc.OpenIDConnectClient
createAuthRedirectUri, createAuthRedirectUri, createAuthRedirectUri, createNonce, createUserInfoFromIdTokenJwtClaims, getAuthRedirect, getJwtClaimsSet, getNonce, getSessionInfo, handleNativePostAuth, jwtClaimsAsJsonValue, mapToUserInfo, validateSub
-
Methods inherited from class org.forgerock.oauth.clients.oauth2.OAuth2Client
createAuthorizationState, createAuthRedirectUri, createPkceVerifier, createPostAuthResponse, createPostResponse, createRequestForIntrospectEndpoint, createRequestForTokenEndpoint, createRequestForTokenEndpoint, createRequestForTokenRefresh, createRequestForUserInfoEndpoint, getAccessToken, getAccessTokenInfo, getConfig, getFirstValueOrNull, getTokenEndpointHandler, mapToJsonValue, mapToUserInfo, refresh, storeResponse, throwIfNoClientSecret, validateClientId
-
-
-
-
Constructor Detail
-
AppleClient
public AppleClient(Handler httpHandler, AppleClientConfiguration config, Clock clock, SecureRandom random)
Constructs aAppleClient
.- Parameters:
httpHandler
- handler used to make http calls to auth and resource serversconfig
- configuration used to drive the oauth flowclock
- Clock instancerandom
- used to generate opaque, cryptographically secure strings
-
AppleClient
public AppleClient(Handler httpHandler, OpenIDConnectClientConfiguration config, Clock clock, SecureRandom random, OpenIdResolverService resolverService, OpenIdResolverServiceConfigurator serviceConfigurator)
Constructs aAppleClient
.- Parameters:
httpHandler
- handler used to make http calls to auth and resource serversconfig
- configuration used to drive the oauth flowclock
- Clock instancerandom
- used to generate opaque, cryptographically secure stringsresolverService
-OpenIdResolverServiceImpl
. OpenID resolvers instance that also contains the JwksStoreCache. By providing the same instance of resolvers for every OpenIdConnectClient the same JwksCache will be usedserviceConfigurator
-OpenIdResolverServiceConfigurator
-
-
Method Detail
-
buildQuery
protected Form buildQuery(String nonce)
Adds the response_mode to the request.- Overrides:
buildQuery
in classOpenIDConnectClient
- Parameters:
nonce
- opaque value used to mitigate replay attacks of an id_token.- Returns:
- the query with response_mode
-
handlePostAuth
public Promise<JsonValue,OAuthException> handlePostAuth(DataStore dataStore, Map<String,List<String>> requestParameters)
Description copied from interface:OAuthClient
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 theOAuthClient.getAuthRedirect(DataStore, String, URI)
call. Validate the request as secure. The returnedJsonValue
response will also contain the data passed toOAuthClient.getAuthRedirect(DataStore, String, URI)
.- Specified by:
handlePostAuth
in interfaceOAuthClient
- Overrides:
handlePostAuth
in classOpenIDConnectClient
- Parameters:
dataStore
- The data store that contains information about the OAuth interaction.requestParameters
- The request parameters containing the data produced by the external authentication server.- Returns:
Promise
, with a type ofJsonValue
, containing the landing page and the data value that was stored in the data store during theOAuthClient.getAuthRedirect(DataStore, String, URI)
call;Promise
, with a type ofOAuthException
, when an error occurs.
-
getUserInfo
public Promise<UserInfo,OAuthException> getUserInfo(DataStore dataStore)
Description copied from interface:OAuthClient
Return the authenticated user's info from the external authentication server.- Specified by:
getUserInfo
in interfaceOAuthClient
- Overrides:
getUserInfo
in classOpenIDConnectClient
- Parameters:
dataStore
- The data store that contains information about the OAuth interaction.- Returns:
Promise
, with a type ofUserInfo
, containing the available user info.Promise
, with a type ofOAuthException
, when an error occurs.
-
-