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 pluggable interface. This can be implemented to make it work with an external system, or with a normal wikipage, or even a flat text-file.

The code:

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;
            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 15:18 by Mortena.