com.threerings.presents.server
Class Authenticator

java.lang.Object
  extended by com.threerings.presents.server.Authenticator
Direct Known Subclasses:
ChainedAuthenticator, DummyAuthenticator, Rejector.RejectingAuthenticator

public abstract class Authenticator
extends Object

The authenticator is a pluggable component of the authentication framework. The base class handles the basic mechanics of authentication and a system would extend the base authenticator and add code that does the actual client authentication.


Nested Class Summary
protected static class Authenticator.AuthException
          An exception that can be thrown during processAuthentication(com.threerings.presents.server.net.AuthingConnection, com.threerings.presents.net.AuthResponse).
 
Constructor Summary
Authenticator()
           
 
Method Summary
 void authenticateConnection(Invoker invoker, AuthingConnection conn, ResultListener<AuthingConnection> onComplete)
          Called by the connection management code when an authenticating connection has received its authentication request from the client.
protected  AuthResponseData createResponseData()
          Create a new AuthResponseData instance to use for authenticating a connection.
protected abstract  void processAuthentication(AuthingConnection conn, AuthResponse rsp)
          Process the authentication for the specified connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Authenticator

public Authenticator()
Method Detail

authenticateConnection

public void authenticateConnection(Invoker invoker,
                                   AuthingConnection conn,
                                   ResultListener<AuthingConnection> onComplete)
Called by the connection management code when an authenticating connection has received its authentication request from the client.


createResponseData

protected AuthResponseData createResponseData()
Create a new AuthResponseData instance to use for authenticating a connection.


processAuthentication

protected abstract void processAuthentication(AuthingConnection conn,
                                              AuthResponse rsp)
                                       throws Exception
Process the authentication for the specified connection. The method may return after it has stuffed a valid response code in rsp.getData().code.

Parameters:
conn - The client connection.
rsp - The response to the client, which will already contain an AuthResponseData created by createResponseData().
Throws:
Exception