jrun.security
Class XMLLoginModule

jrun.security.XMLLoginModule

public final class XMLLoginModule

JAAS Login Module for default user authentication. Uses the default JRunUserManager service as the data source for user security information Based on the "mode" parameter from the config file login module entry, the login method authenticates the user and password or validates that the user is in the specified roles collection Never use JNDI inside JRun LoginModules. Could lead to infinite loops


Field Summary
protected  javax.security.auth.callback.CallbackHandler cbHandler
           
protected  java.lang.String loginMode
           
protected  java.util.Map options
           
protected  java.util.Map sharedState
           
protected  javax.security.auth.Subject subject
           
 
Constructor Summary
XMLLoginModule()
           
 
Method Summary
 boolean abort()
           This method is called if the LoginContext's overall authentication failed.
 boolean commit()
           This method is called if the LoginContext's overall authentication succeeded (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules succeeded).
 void initialize(javax.security.auth.Subject subj, javax.security.auth.callback.CallbackHandler cbh, java.util.Map sharedState, java.util.Map options)
          Initialize method for the Login Module options param provides the XML filename to read see JAAS javadoc for detailed explanation
 boolean login()
          Login method called by the LoginContext.
protected  boolean loginUser()
           
 boolean logout()
          Logout the user.
protected  boolean validateRole()
           
 

Field Detail

subject

protected javax.security.auth.Subject subject

cbHandler

protected javax.security.auth.callback.CallbackHandler cbHandler

sharedState

protected java.util.Map sharedState

options

protected java.util.Map options

loginMode

protected java.lang.String loginMode
Constructor Detail

XMLLoginModule

public XMLLoginModule()
Method Detail

initialize

public void initialize(javax.security.auth.Subject subj,
                       javax.security.auth.callback.CallbackHandler cbh,
                       java.util.Map sharedState,
                       java.util.Map options)
Initialize method for the Login Module options param provides the XML filename to read see JAAS javadoc for detailed explanation

login

public boolean login()
              throws javax.security.auth.login.LoginException
Login method called by the LoginContext. Get the username and Password from the Callback Handler. Validate them against the read in values.

loginUser

protected boolean loginUser()
                     throws javax.security.auth.login.LoginException

validateRole

protected boolean validateRole()
                        throws javax.security.auth.login.LoginException

commit

public boolean commit()
               throws javax.security.auth.login.LoginException

This method is called if the LoginContext's overall authentication succeeded (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules succeeded).

If this LoginModule's own authentication attempt succeeded (checked by retrieving the private state saved by the login method), then this method associates a SimplePrincipal with the Subject located in the LoginModule. If this LoginModule's own authentication attempted failed, then this method removes any state that was originally saved.

Returns:
true if this LoginModule's own login and commit attempts succeeded, or false otherwise.
Throws:
LoginException - if the commit fails.

abort

public boolean abort()
              throws javax.security.auth.login.LoginException

This method is called if the LoginContext's overall authentication failed. (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules did not succeed).

If this LoginModule's own authentication attempt succeeded (checked by retrieving the private state saved by the login and commit methods), then this method cleans up any state that was originally saved.

Returns:
false if this LoginModule's own login and/or commit attempts failed, and true otherwise.
Throws:
LoginException - if the abort fails.

logout

public boolean logout()
               throws javax.security.auth.login.LoginException
Logout the user.

This method removes the SamplePrincipal that was added by the commit method.

Returns:
true in all cases since this LoginModule should not be ignored.
Throws:
LoginException - if the logout fails.


Copyright � 2002 Macromedia Corporation. All Rights Reserved.