|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.resource.Resource
org.restlet.resource.UniformResource
org.restlet.resource.ServerResource
org.restlet.ext.oauth.OAuthServerResource
org.restlet.ext.oauth.AuthorizationServerResource
public class AuthorizationServerResource
Restlet implementation class AuthorizationService. Used for initiating an
OAuth 2.0 authorization request.
This Resource is controlled by to Context Attribute Parameters
OAuthServerResource.LOGIN_PARAM specifies the location of a Login resource.
Implements OAuth 2.0 draft 10
The following example shows how to set up a simple Authorization Service.
{
@code
public Restlet createInboundRoot(){
...
ChallengeAuthenticator au = new ChallengeAuthenticator(getContext(),
ChallengeScheme.HTTP_BASIC, "OAuth Test Server");
au.setVerifier(new MyVerifier());
au.setNext(AuthorizationServerResource.class);
root.attach("/authorize", au);
...
}
| Field Summary |
|---|
| 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 |
| Constructor Summary | |
|---|---|
AuthorizationServerResource()
|
|
| Method Summary | |
|---|---|
protected Representation |
doPostAuthenticate(org.restlet.ext.oauth.internal.AuthSession session,
Client client)
Handle the authentication request. |
Representation |
represent()
Checks that all incoming requests have a type parameter. |
void |
sendError(String sessionId,
OAuthError error,
String state)
Helper method to format error responses according to OAuth2 spec. |
void |
sendError(String sessionId,
OAuthError error,
String state,
String description,
String errorUri)
Helper method to format error responses according to OAuth2 spec. |
protected void |
setupSession(org.restlet.ext.oauth.internal.AuthSession in,
Client client,
ResponseType flow,
String redirUri,
Form params)
Sets up a session. |
| Methods inherited from class org.restlet.ext.oauth.OAuthServerResource |
|---|
doInit, generateAgentToken, generateCode, getParameter, parseScope |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AuthorizationServerResource()
| Method Detail |
|---|
@Get(value="html") @Post(value="html") public Representation represent()
protected void setupSession(org.restlet.ext.oauth.internal.AuthSession in,
Client client,
ResponseType flow,
String redirUri,
Form params)
in - The OAuth session.client - The OAuth client.flow - The glow.redirUri - The redirection URI.params - The authentication parameters.
protected Representation doPostAuthenticate(org.restlet.ext.oauth.internal.AuthSession session,
Client client)
session - The OAuth session.client - The OAuth client.
Representation.
public void sendError(String sessionId,
OAuthError error,
String state)
sessionId - local server session objecterror - code, one of the valid from specstate - state parameter as presented in the initial auth request
public void sendError(String sessionId,
OAuthError error,
String state,
String description,
String errorUri)
sessionId - local server session objecterror - code, one of the valid from specstate - state parameter as presented in the initial auth requestdescription - any text describing the errorerrorUri - uri to a page with more description about the error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||