This is version . It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]
The Authenticator is a plugable interface:

package ...

public abstract class Authenticator {

    public boolean Login(String username, String password, HttpServletRequest request){
        Wiki wiki = ...;
        WikiUserPrincipal user = getWikiUserPrincipal(username,password,wiki);
        if ( user == null)
            return false;
        else
            request.getSession.setAttribute("user", user);
    }


    /**
    * This method is responsible for controlling the username and password against 
    * some persistently saved mapping of these. The method returns a WikiUserPrincipal if 
    * the user can log in else null is returned (Maybe an exception or error should be thrown instead).
    */
    protected abstract WikiUserPrincipal getWikiUserPrincipal(String username, String password, WikiEngine wiki);

}

Add new attachment

Only authorized users are allowed to upload new attachments.
« This particular version was published on 21-Oct-2002 14:42 by Mortena.