FileDocCategorySizeDatePackage
PasswordLoginModule.javaAPI DocGlassfish v2 API4430Fri May 04 22:35:26 BST 2007com.sun.enterprise.security.auth.login

PasswordLoginModule

public abstract class PasswordLoginModule extends com.sun.appserv.security.AppservPasswordLoginModule
Abstract base class for password-based login modules. Newer implementations should extend com.sun.appserv.security.AbstractLoginModule. This class is provided for backward compatibility and is a candidate for deprecation.

Fields Summary
Constructors Summary
Methods Summary
protected abstract voidauthenticate()
Perform authentication decision. Method returns silently on success and returns a LoginException on failure. To be implmented by sub-classes

return
void authenticate returns silently on successful authentication.
throws
com.sun.enterprise.security.LoginException on authentication failure.

protected final voidauthenticateUser()
Older implementations can implement authenticate. While new implementation calls authenticateUser

throws
LoginException

        authenticate();
    
public final voidcommitAuthentication(java.lang.String username, java.lang.String password, com.sun.enterprise.security.auth.realm.Realm theRealm, java.lang.String[] groups)
Maintain RI compatibility.

This is a convenience method which can be used by subclasses to complete the steps required by RI legacy authentication code. Most of this should go away if a clean JAAS/Subject based infrastructure is provided. But for now this must be done.

Note that this method is called after the authentication has succeeded. If authentication failed do not call this method.

A lot of the RI behavior is still present here. Some of the most notable points to remember:

  • Global instance field succeeded is set to true by this method.

    param
    username Name of authenticated user.
    param
    password Password of this user.
    param
    theRealm Current Realm object for this authentication.
    param
    groups String array of group memberships for user (could be empty).
    returns
    void

            commitUserAuthentication(groups);