Package org.forgerock.secrets.oauth2
Class AuthorizationCodeGrantTypeHandler
java.lang.Object
org.forgerock.secrets.oauth2.GrantTypeHandler
org.forgerock.secrets.oauth2.AuthorizationCodeGrantTypeHandler
A handler that can send an authorization code and optional PKCE verifier to the token endpoint to receive an
access token. The authorization code should be obtained prior to creating this grant type handler.
-
Constructor Summary
ConstructorDescriptionAuthorizationCodeGrantTypeHandler
(String clientId, String authorizationCode) Initialises the grant type handler with the given parameters.AuthorizationCodeGrantTypeHandler
(String clientId, String authorizationCode, String redirectUri, String pkceVerifier) Initialises the grant type handler with the given parameters. -
Method Summary
Methods inherited from class org.forgerock.secrets.oauth2.GrantTypeHandler
getClientId, getGrantType, getScope, toString
-
Constructor Details
-
AuthorizationCodeGrantTypeHandler
public AuthorizationCodeGrantTypeHandler(String clientId, String authorizationCode, String redirectUri, String pkceVerifier) Initialises the grant type handler with the given parameters.- Parameters:
clientId
- the id of the client making the request.authorizationCode
- the authorization code.redirectUri
- the redirect_uri that was used in the authorization request, or null if not used.pkceVerifier
- the PKCE code verifier, or null if not used.
-
AuthorizationCodeGrantTypeHandler
Initialises the grant type handler with the given parameters. No redirect uri or PKCE verifier will be sent on the request.- Parameters:
clientId
- the id of the client making the request.authorizationCode
- the authorization code.
-
-
Method Details
-
handle
Description copied from class:GrantTypeHandler
Handles the request by adding appropriate parameters to the OAuth 2.0 token endpoint request.- Overrides:
handle
in classGrantTypeHandler
- Parameters:
tokenEndpointRequest
- the original token endpoint request.form
- the POST body to add parameters to.- Returns:
- a promise for the token endpoint request with parameters appropriate for this grant type.
-