|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nimbusds.oauth2.sdk.AbstractRequest
com.nimbusds.oauth2.sdk.TokenRequest
com.nimbusds.oauth2.sdk.AccessTokenRequest
@Immutable public final class AccessTokenRequest
Access token request to the Token endpoint. Used to obtain an
access token
and an
optional refresh token
from the authorisation server. This class is immutable.
Supported authorisation grant types:
Example HTTP request, with
client secret basic
authentication:
POST /token HTTP/1.1 Host: server.example.com Content-Type: application/x-www-form-urlencoded Authorization: Basic czZCaGRSa3F0MzpnWDFmQmF0M2JW grant_type=authorization_code &code=SplxlOBeZQQYbYS6WxSbIA &redirect_uri=https%3A%2F%2Fclient.example.org%2Fcb
Related specifications:
Constructor Summary | |
---|---|
AccessTokenRequest(URL uri,
AuthorizationCode code,
URL redirectURI,
ClientAuthentication clientAuth)
Creates a new authenticated access token request, using an authorisation code grant . |
|
AccessTokenRequest(URL uri,
AuthorizationCode code,
URL redirectURI,
ClientID clientID)
Creates a new unauthenticated access token request, using an authorisation code grant . |
|
AccessTokenRequest(URL uri,
Scope scope,
ClientAuthentication clientAuth)
Creates a new authenticated access token request, using a client credentials grant . |
|
AccessTokenRequest(URL uri,
String username,
String password,
Scope scope)
Creates a new authenticated access token request, using a resource owner password credentials
grant . |
Method Summary | |
---|---|
AuthorizationCode |
getAuthorizationCode()
Gets the authorisation code. |
ClientID |
getClientID()
Gets the client identifier. |
String |
getPassword()
Gets the resource owner password. |
URL |
getRedirectURI()
Gets the redirect URI. |
Scope |
getScope()
Gets the access scope. |
String |
getUsername()
Gets the resource owner username. |
static AccessTokenRequest |
parse(HTTPRequest httpRequest)
Parses the specified HTTP request for an access token request. |
HTTPRequest |
toHTTPRequest()
Returns the matching HTTP request. |
Methods inherited from class com.nimbusds.oauth2.sdk.TokenRequest |
---|
getClientAuthentication, getGrantType |
Methods inherited from class com.nimbusds.oauth2.sdk.AbstractRequest |
---|
getURI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AccessTokenRequest(URL uri, AuthorizationCode code, URL redirectURI, ClientID clientID)
authorisation code grant
.
uri
- The URI of the token endpoint. May be
null
if the toHTTPRequest()
method will not be used.code
- The authorisation code received from the
authorisation server. Must not be null
.redirectURI
- The redirect URI, may be null
if
specified in the initial authorisation request.clientID
- The client identifier. Must not be null
.public AccessTokenRequest(URL uri, AuthorizationCode code, URL redirectURI, ClientAuthentication clientAuth)
authorisation code grant
.
uri
- The URI of the token endpoint. May be
null
if the toHTTPRequest()
method will not be used.code
- The authorisation code received from the
authorisation server. Must not be null
.redirectURI
- The redirect URI, may be null
if not
specified in the initial authorisation request.clientAuth
- The client authentication. Must not be
null
.public AccessTokenRequest(URL uri, String username, String password, Scope scope)
resource owner password credentials
grant
.
uri
- The URI of the token endpoint. May be null
if the toHTTPRequest()
method will not be
used.username
- The resource owner username. Must not be
null
.password
- The resource owner password. Must not be
null
.scope
- The scope of the access request, null
if not
specified.public AccessTokenRequest(URL uri, Scope scope, ClientAuthentication clientAuth)
client credentials grant
.
uri
- The URI of the token endpoint. May be
null
if the toHTTPRequest()
method will not be used.scope
- The scope of the access request, null
if
not specified.clientAuth
- The client authentication. Must not be
null
.Method Detail |
---|
public AuthorizationCode getAuthorizationCode()
authorisation code grant
.
null
if not specified.public URL getRedirectURI()
authorisation code grant
null
if not specified.public ClientID getClientID()
authorisation code grant
.
null
if not specified.public String getUsername()
resource owner password credentials
grant
.
null
if not specified.public String getPassword()
resource owner password credentials
grant
.
null
if not specified.public Scope getScope()
resource owner password credentials
or
client credentials grant
.
null
if not specified.public HTTPRequest toHTTPRequest() throws SerializeException
Request
SerializeException
- If the request message couldn't be
serialised to an HTTP request.public static AccessTokenRequest parse(HTTPRequest httpRequest) throws ParseException
httpRequest
- The HTTP request. Must not be null
.
ParseException
- If the HTTP request couldn't be parsed to an
access token request.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |