@Immutable public class AuthorizationCodeGrant extends AuthorizationGrant
Related specifications:
Modifier and Type | Field | Description |
---|---|---|
static GrantType |
GRANT_TYPE |
The grant type.
|
Constructor | 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 | 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,List<String>> params) |
Parses an authorisation code grant from the specified request body
parameters.
|
Map<String,List<String>> |
toParameters() |
Returns the request body parameters for the authorisation grant.
|
getType
public 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,List<String>> toParameters()
AuthorizationGrant
toParameters
in class AuthorizationGrant
public static AuthorizationCodeGrant parse(Map<String,List<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 © 2019 Connect2id Ltd.. All rights reserved.