Restlet Framework 2.2.2
Google App Engine

org.restlet.ext.gae
Class GaeAuthenticator

java.lang.Object
  extended by org.restlet.Restlet
      extended by org.restlet.routing.Filter
          extended by org.restlet.security.Authenticator
              extended by org.restlet.ext.gae.GaeAuthenticator
All Implemented Interfaces:
Uniform

public class GaeAuthenticator
extends Authenticator

Authenticator that provides an integration to the Google App Engine UserService.

Author:
Matt Kennedy

Field Summary
 
Fields inherited from class org.restlet.routing.Filter
CONTINUE, SKIP, STOP
 
Constructor Summary
GaeAuthenticator(Context context)
          Constructor setting the mode to "required".
GaeAuthenticator(Context context, boolean optional)
          Constructor using the context's default enroler.
GaeAuthenticator(Context context, boolean optional, Enroler enroler)
          Constructor.
 
Method Summary
protected  boolean authenticate(Request request, Response response)
          Integrates with Google App Engine UserService to redirect non-authenticated users to the GAE login URL.
 
Methods inherited from class org.restlet.security.Authenticator
authenticated, beforeHandle, getEnroler, isMultiAuthenticating, isOptional, setEnroler, setMultiAuthenticating, setOptional, unauthenticated
 
Methods inherited from class org.restlet.routing.Filter
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
 
Methods inherited from class org.restlet.Restlet
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaeAuthenticator

public GaeAuthenticator(Context context)
Constructor setting the mode to "required".

Parameters:
context - The context.
See Also:
#Authenticator(Context)

GaeAuthenticator

public GaeAuthenticator(Context context,
                        boolean optional)
Constructor using the context's default enroler.

Parameters:
context - The context.
optional - The authentication mode.
See Also:
#Authenticator(Context, boolean, Enroler)

GaeAuthenticator

public GaeAuthenticator(Context context,
                        boolean optional,
                        Enroler enroler)
Constructor.

Parameters:
context - The context.
optional - The authentication mode.
enroler - The enroler to invoke upon successful authentication.
Method Detail

authenticate

protected boolean authenticate(Request request,
                               Response response)
Integrates with Google App Engine UserService to redirect non-authenticated users to the GAE login URL. Upon successful login, creates a Restlet User object based values in GAE user object. The GAE "nickname" property gets mapped to the Restlet "firstName" property.

Specified by:
authenticate in class Authenticator
Parameters:
request - The request sent.
response - The response to update.
Returns:
True if the authentication succeeded.

Restlet Framework 2.2.2
Google App Engine

Copyright © 2005-2014 Restlet.