@Deprecated public class OAuthProxy extends Filter implements OAuthResourceDefs
{ @code OAuthProxy proxy = new OauthProxy(getContext(), true); proxy.setClientId("clientId"); proxy.setClientSecret("clientSecret"); proxy.setRedirectURI("callbackURI"); proxy.setAuthorizationURI("authURI"); proxy.setTokenURI("tokenURI"); proxy.setNext(DummyResource.class); router.attach("/write", write); }
OAuthParameters
ACCESS_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 |
---|
OAuthProxy(Context context)
Deprecated.
Sets up an OauthProxy.
|
OAuthProxy(Context context,
boolean useBasicSecret)
Deprecated.
Sets up an OAuthProxy.
|
OAuthProxy(Context context,
boolean useBasicSecret,
Client requestClient)
Deprecated.
Sets up an OAuthProxy.
|
Modifier and Type | Method and Description |
---|---|
protected int |
beforeHandle(Request request,
Response response)
Deprecated.
|
protected OAuthParameters |
createAuthorizationRequest()
Deprecated.
Returns the set of Oauth parameters used to generate the URI of the Authorization request.
|
protected OAuthParameters |
createTokenRequest(java.lang.String code)
Deprecated.
Returns the set of Oauth parameters used to generate the URI of the token request.
|
java.lang.String |
getAuthorizationURI()
Deprecated.
|
java.lang.String |
getClientId()
Deprecated.
|
java.lang.String |
getClientSecret()
Deprecated.
|
protected Representation |
getErrorPage(java.lang.Exception ex)
Deprecated.
Return an HTML representation of the given exception.
|
java.lang.String |
getRedirectURI()
Deprecated.
|
java.lang.String[] |
getScope()
Deprecated.
|
java.lang.String |
getTokenURI()
Deprecated.
|
static java.lang.String |
getVersion()
Deprecated.
Returns the current proxy's version.
|
void |
setAuthorizationURI(java.lang.String authorizationURI)
Deprecated.
|
void |
setClientId(java.lang.String clientId)
Deprecated.
|
void |
setClientSecret(java.lang.String clientSecret)
Deprecated.
|
void |
setRedirectURI(java.lang.String redirectURI)
Deprecated.
|
void |
setScope(java.lang.String[] scope)
Deprecated.
|
void |
setTokenURI(java.lang.String tokenURI)
Deprecated.
|
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
public OAuthProxy(Context context)
context
- The Restlet context.public OAuthProxy(Context context, boolean useBasicSecret)
useBasicSecret
- If true use http basic authentication otherwise use form
based.context
- The Restlet context.public OAuthProxy(Context context, boolean useBasicSecret, Client requestClient)
useBasicSecret
- If true use http basic authentication otherwise use form based.context
- The Restlet context.requestClient
- A predefined client that will be used for remote client request. Useful when you need to set e.g. SSL
initialization parameters.public static java.lang.String getVersion()
protected int beforeHandle(Request request, Response response)
beforeHandle
in class Filter
protected OAuthParameters createAuthorizationRequest()
protected OAuthParameters createTokenRequest(java.lang.String code)
public java.lang.String getAuthorizationURI()
public java.lang.String getClientId()
public java.lang.String getClientSecret()
protected Representation getErrorPage(java.lang.Exception ex)
ex
- The exception to representation.public java.lang.String getRedirectURI()
public java.lang.String[] getScope()
public java.lang.String getTokenURI()
public void setAuthorizationURI(java.lang.String authorizationURI)
authorizationURI
- the authorizationURI to setpublic void setClientId(java.lang.String clientId)
clientId
- the clientId to setpublic void setClientSecret(java.lang.String clientSecret)
clientSecret
- the clientSecret to setpublic void setRedirectURI(java.lang.String redirectURI)
redirectURI
- the redirectURI to setpublic void setScope(java.lang.String[] scope)
scope
- the scope to setpublic void setTokenURI(java.lang.String tokenURI)
tokenURI
- the tokenURI to setCopyright © 2005-2020 Restlet.