com.google.enterprise.adaptor
Interface AuthnAuthority


public interface AuthnAuthority

Interface for adaptors capable of authenticating users.

Instances of this interface are typically registered with AdaptorContext.setAuthnAuthority(com.google.enterprise.adaptor.AuthnAuthority).


Nested Class Summary
static interface AuthnAuthority.Callback
          Interface for replying to AuthnAdaptor.authenticateUser(HttpExchange, Callback).
 
Method Summary
 void authenticateUser(HttpExchange ex, AuthnAuthority.Callback callback)
          Authenticate the user connected via ex.
 

Method Detail

authenticateUser

void authenticateUser(HttpExchange ex,
                      AuthnAuthority.Callback callback)
                      throws IOException
Authenticate the user connected via ex. After attempting to authenticate the user the implementation should respond by calling AuthnAuthority.Callback.userAuthenticated(com.sun.net.httpserver.HttpExchange, com.google.enterprise.adaptor.AuthnIdentity).

The implementation is expected to provide a response to the user with ex. Since authentication commonly requires redirects, forms, and other general HTTP mechanisms, full control is given to the implementation. The implementation will likely need to use its own HttpHandlers that can be registered with AdaptorContext.createHttpContext(java.lang.String, com.sun.net.httpserver.HttpHandler).

If an implementation places callback in a session object, the implementation should also remove the instance when userAuthenticated() is called. This is to release resources as well as preventing re-use of the callback.

Parameters:
ex - exchange whose request body has been processed, but whose response body and headers have not been sent
callback - object to receive and respond with authentication results
Throws:
IOException