@Immutable public class AuthorizationCodeGrant extends AuthorizationGrant
Related specifications:
| Modifier and Type | Field and Description |
|---|---|
static GrantType |
GRANT_TYPE
The grant type.
|
| Constructor and Description |
|---|
AuthorizationCodeGrant(AuthorizationCode code,
URI redirectURI)
Creates a new authorisation code grant.
|
AuthorizationCodeGrant(AuthorizationCode code,
URI redirectURI,
CodeVerifier codeVerifier)
Creates a new authorisation code grant.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
AuthorizationCode |
getAuthorizationCode()
Gets the authorisation code.
|
CodeVerifier |
getCodeVerifier()
Gets the authorisation code verifier for PKCE.
|
URI |
getRedirectionURI()
Gets the redirection URI of the original authorisation request.
|
int |
hashCode() |
static AuthorizationCodeGrant |
parse(Map<String,String> params)
Parses an authorisation code grant from the specified parameters.
|
Map<String,String> |
toParameters()
Return the parameters for the authorisation grant.
|
getTypepublic static final GrantType GRANT_TYPE
public AuthorizationCodeGrant(AuthorizationCode code, URI redirectURI)
code - The authorisation code. Must not be null.redirectURI - The redirection URI of the original authorisation
request. Required if the {redirect_uri}
parameter was included in the authorisation
request, else null.public AuthorizationCodeGrant(AuthorizationCode code, URI redirectURI, CodeVerifier codeVerifier)
code - The authorisation code. Must not be null.redirectURI - The redirection URI of the original
authorisation request. Required if the
{redirect_uri} parameter was included in the
authorisation request, else null.codeVerifier - The authorisation code verifier for PKCE,
null if not specified.public AuthorizationCode getAuthorizationCode()
public URI getRedirectionURI()
null if the
redirect_uri parameter was not included in the
original authorisation request.public CodeVerifier getCodeVerifier()
null if not
specified.public Map<String,String> toParameters()
AuthorizationGranttoParameters in class AuthorizationGrantpublic static AuthorizationCodeGrant parse(Map<String,String> params) throws ParseException
Example:
grant_type=authorization_code code=SplxlOBeZQQYbYS6WxSbIA redirect_uri=https://Fclient.example.com/cb
params - The parameters.ParseException - If parsing failed.Copyright © 2017 Connect2id Ltd.. All rights reserved.