net.sf.ooweb.objectmapping
Interface Authenticator


public interface Authenticator

Application code implements Authenticator in order to participate in the OOWeb security framework.

OOWeb will instantiate this named class (which must have a public, no-arg constructor) and call its login() method, passing the values for username and password garnered from the current request.

Since:
0.5
Author:
Darren Davison
See Also:
User

Method Summary
 User authenticate(java.lang.String username, java.lang.String password)
          This method should authenticate the credentials passed to the web framework by the web user.
 

Method Detail

authenticate

User authenticate(java.lang.String username,
                  java.lang.String password)
                  throws java.lang.Exception
This method should authenticate the credentials passed to the web framework by the web user. If the name/password combination are valid the login method returns a User object representing that user which is stored in the session.

Parameters:
username - the value submitted by the web user
password - the value submitted by the web user
Returns:
an object which should represent the authenticated user as far as the web application is concerned. The object will be added to the session, keyed under the name specified by the SecurityManager's USER_SESSION_KEY field. A return value of null will be taken to mean an authentication failure by OOWeb
Throws:
java.lang.Exception - if the name/password cannot be authenticated. Any Exception at all will be taken to mean authentication failure by OOWeb


Copyright (C) 2005-2007 OOWeb Authors.