@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.
|
Modifier and Type | Method and Description |
---|---|
AuthorizationCode |
getAuthorizationCode()
Gets the authorisation code.
|
URI |
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.
|
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 AuthorizationCode getAuthorizationCode()
public URI getRedirectionURI()
null
if the
redirect_uri
parameter was not included in the
original authorisation request.public Map<String,String> toParameters()
AuthorizationGrant
toParameters
in class AuthorizationGrant
public 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 © 2014 Connect2id Ltd.. All Rights Reserved.