org.restlet.ext.oauth
Class AccessTokenServerResource
java.lang.Object
org.restlet.resource.Resource
org.restlet.resource.UniformResource
org.restlet.resource.ServerResource
org.restlet.ext.oauth.OAuthServerResource
org.restlet.ext.oauth.AccessTokenServerResource
public class AccessTokenServerResource
- extends OAuthServerResource
Server resource used to acquire an OAuth token. A code, or refresh token can
be exchanged for a working token. This resource also supports the none flow.
Note: at the moment password and assertion flows are not supported.
Implements OAuth 2.0 draft 10
Example. Attach an AccessTokenServerResource
{
@code
public Restlet createInboundRoot(){
...
root.attach("/access_token", AccessTokenServerResource.class);
...
}
}
- Author:
- Kristoffer Gronowski
- See Also:
- OAuth
2 draft 10
Fields inherited from class org.restlet.ext.oauth.OAuthServerResource |
ACCESS_TOKEN, ASSERTION, ASSERTION_TYPE, AUTONOMOUS_USER, CLIENT_ID, CLIENT_SECRET, ClientCookieID, clients, CODE, ERROR, ERROR_DESC, ERROR_URI, EXPIRES_IN, generator, GRANT_TYPE, noCache, noStore, OAUTH_TOKEN, PASSWORD, REDIR_URI, REFRESH_TOKEN, RESPONSE_TYPE, SCOPE, STATE, TOKEN_SERVER_MAX_TIME_SEC, TOKEN_SERVER_TIME_SEC, tokenMaxTimeSec, tokenTimeSec, USERNAME |
Methods inherited from class org.restlet.resource.ServerResource |
abort, commit, delete, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, get, getAttribute, getInfo, getInfo, getOnSent, getPreferredVariant, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, options, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDimensions, setExisting, setLocationRef, setLocationRef, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensions |
Methods inherited from class org.restlet.resource.Resource |
doError, 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, toObject, toRepresentation, toString |
AccessTokenServerResource
public AccessTokenServerResource()
represent
@Post(value="form:json")
public Representation represent(Representation input)
- Handles the
Post
request.
- Parameters:
input
- HTML form formated token request per oauth-v2 spec.
- Returns:
- JSON response with token or error.
sendError
protected Representation sendError(OAuthError error,
String description,
String errorUri)
- Returns the representation of the given error.
- Parameters:
error
- The OAuth error.description
- The error description.errorUri
- the error URI.
- Returns:
- The representation of the given error.
Copyright © 2005-2013 Restlet.