@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,
java.net.URI redirectURI)
Creates a new authorisation code grant.
|
AuthorizationCodeGrant(AuthorizationCode code,
java.net.URI redirectURI,
CodeVerifier codeVerifier)
Creates a new authorisation code grant.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
AuthorizationCode |
getAuthorizationCode()
Gets the authorisation code.
|
CodeVerifier |
getCodeVerifier()
Gets the authorisation code verifier for PKCE.
|
java.net.URI |
getRedirectionURI()
Gets the redirection URI of the original authorisation request.
|
int |
hashCode() |
static AuthorizationCodeGrant |
parse(java.util.Map<java.lang.String,java.lang.String> params)
Parses an authorisation code grant from the specified parameters.
|
java.util.Map<java.lang.String,java.lang.String> |
toParameters()
Return the parameters for the authorisation grant.
|
getTypepublic static final GrantType GRANT_TYPE
public AuthorizationCodeGrant(AuthorizationCode code, java.net.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, java.net.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 java.net.URI getRedirectionURI()
null if the
redirect_uri parameter was not included in the
original authorisation request.public CodeVerifier getCodeVerifier()
null if not
specified.public java.util.Map<java.lang.String,java.lang.String> toParameters()
AuthorizationGranttoParameters in class AuthorizationGrantpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static AuthorizationCodeGrant parse(java.util.Map<java.lang.String,java.lang.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 © 2016 Connect2id Ltd.. All Rights Reserved.