@Deprecated public class AccessTokenServerResource extends OAuthServerResource
{
@code
public Restlet createInboundRoot() {
...
root.attach("/token", AccessTokenServerResource.class);
...
}
}
clients, PARAMETER_DEFAULT_SCOPE, tokensACCESS_TOKEN, CLIENT_ID, CLIENT_SECRET, CODE, ERROR, ERROR_DESC, ERROR_URI, EXPIRES_IN, GRANT_TYPE, PASSWORD, REDIR_URI, REFRESH_TOKEN, RESPONSE_TYPE, SCOPE, STATE, TOKEN_TYPE, TOKEN_TYPE_BEARER, TOKEN_TYPE_MAC, USERNAME| Constructor and Description |
|---|
AccessTokenServerResource()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doCatch(java.lang.Throwable t)
Deprecated.
Handles errors as described in 5.2 Error Response.
|
protected void |
ensureGrantTypeAllowed(org.restlet.ext.oauth.internal.Client client,
GrantType grantType)
Deprecated.
|
protected org.restlet.ext.oauth.internal.Client |
getAuthenticatedClient()
Deprecated.
|
protected org.restlet.ext.oauth.internal.Client |
getClient(Form params)
Deprecated.
Get request parameter "client_id".
|
protected java.lang.String |
getCode(Form parameters)
Deprecated.
Returns the value of the request parameter "code".
|
protected GrantType |
getGrantType(Form parameters)
Deprecated.
Returns the value of the request parameter "grant_type".
|
protected java.lang.String |
getPassword(Form parameters)
Deprecated.
Returns the value of the request parameter "password".
|
protected java.lang.String |
getRedirectURI(Form parameters)
Deprecated.
Returns the value of the request parameter "redirect_uri".
|
protected java.lang.String |
getRefreshToken(Form parameters)
Deprecated.
Returns the value of the request parameter "refresh_token".
|
protected java.lang.String |
getUsername(Form parameters)
Deprecated.
Returns the value of the request parameter "username".
|
Representation |
requestToken(Representation input)
Deprecated.
Handles the
Post request. |
protected Representation |
responseTokenRepresentation(org.restlet.ext.oauth.internal.Token token,
java.lang.String[] requestedScope)
Deprecated.
Generates a JSON document with valid token.
|
addCacheDirective, doInit, getScope, getState, responseErrorRepresentationabort, commit, delete, delete, describeVariants, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, get, getAttribute, getDescription, getInfo, getInfo, getName, getOnSent, getPreferredVariant, getRole, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, options, patch, patch, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDescription, setDimensions, setExisting, setLocationRef, setLocationRef, setName, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensionsdoError, doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toBoolean, toByte, toDouble, toFloat, toInteger, toLong, toObject, toRepresentation, toRepresentation, toRepresentation, toShort, toStringprotected void doCatch(java.lang.Throwable t)
doCatch in class ServerResourceprotected void ensureGrantTypeAllowed(org.restlet.ext.oauth.internal.Client client, GrantType grantType) throws OAuthException
OAuthExceptionprotected org.restlet.ext.oauth.internal.Client getAuthenticatedClient() throws OAuthException
OAuthExceptionprotected org.restlet.ext.oauth.internal.Client getClient(Form params) throws OAuthException
OAuthServerResourcegetClient in class OAuthServerResourceOAuthExceptionprotected java.lang.String getCode(Form parameters) throws OAuthException
parameters - OAuthException - In case the parameter is not set.protected GrantType getGrantType(Form parameters) throws OAuthException
parameters - OAuthException - In case the parameter is not set or is an invalid value.protected java.lang.String getPassword(Form parameters) throws OAuthException
parameters - OAuthException - In case the parameter is not set.protected java.lang.String getRedirectURI(Form parameters) throws OAuthException
parameters - OAuthException - In case the parameter is not set.protected java.lang.String getRefreshToken(Form parameters) throws OAuthException
parameters - OAuthException - In case the parameter is not set.protected java.lang.String getUsername(Form parameters) throws OAuthException
parameters - OAuthException - In case the parameter is not set.@Post(value="form:json") public Representation requestToken(Representation input) throws OAuthException, org.json.JSONException
Post request. The client MUST use the HTTP "POST"
method when making access token requests. (3.2. Token Endpoint)input - HTML form formated token request per oauth-v2 spec.OAuthExceptionorg.json.JSONExceptionprotected Representation responseTokenRepresentation(org.restlet.ext.oauth.internal.Token token, java.lang.String[] requestedScope) throws org.json.JSONException
token - The token generated by the client.requestedScope - The scope originally requested by the client.org.json.JSONExceptionCopyright © 2005-2020 Restlet.