@Immutable public final class AuthorizationCodeGrant extends AuthorizationGrant
Related specifications:
| Modifier and Type | Field and Description |
|---|---|
static GrantType |
GRANT_TYPE
The associated grant type.
|
| Constructor and Description |
|---|
AuthorizationCodeGrant(AuthorizationCode code,
URL redirectURI)
Creates a new authorisation code grant.
|
AuthorizationCodeGrant(AuthorizationCode code,
URL redirectURI,
ClientID clientID)
Creates a new authorisation code grant.
|
| Modifier and Type | Method and Description |
|---|---|
AuthorizationCode |
getAuthorizationCode()
Gets the authorisation code.
|
ClientID |
getClientID()
Gets the client identifier.
|
URL |
getRedirectionURI()
Gets the redirection URI of the original authorisation request.
|
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, URL 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, URL redirectURI, ClientID clientID)
code - The authorisation code. Must not be null.redirectURI - The redirection URI of the original authorisation
request, null if the redirect_uri
parameter was not included in the authorisation
request.clientID - The client identifier. Must not be null.public AuthorizationCode getAuthorizationCode()
public URL getRedirectionURI()
null if the
redirect_uri parameter was not included in the
original authorisation request.public ClientID getClientID()
null if not specified
(implies an authenticated access token request).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 © 2013 NimbusDS. All Rights Reserved.