Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.geronimo.security.realm.providers
Class FileAuditLoginModule  view FileAuditLoginModule download FileAuditLoginModule.java

java.lang.Object
  extended byorg.apache.geronimo.security.realm.providers.FileAuditLoginModule
All Implemented Interfaces:
javax.security.auth.spi.LoginModule

public class FileAuditLoginModule
extends java.lang.Object
implements javax.security.auth.spi.LoginModule

Writes audit records to a file for all authentication activity. Currently doesn't perform too well; perhaps the file management should be centralized and the IO objects kept open across many requests. It would also be nice to write in a more convenient XML format. This module does not write any Principals into the Subject. To enable this login module, set your primary login module to REQUIRED or OPTIONAL, and list this module after it (with any setting).

Version:
$Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $

Field Summary
private static java.text.DateFormat DATE_FORMAT
           
private  javax.security.auth.callback.CallbackHandler handler
           
static java.lang.String LOG_FILE_OPTION
           
private  java.io.File logFile
           
private  java.lang.String username
           
 
Constructor Summary
FileAuditLoginModule()
           
 
Method Summary
 boolean abort()
          Abort the current login attempt.
 boolean commit()
          Commit the current login attempt.
 void initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map sharedState, java.util.Map options)
          Initializes this login module.
 boolean login()
          Authenticates a subject to the system.
 boolean logout()
          Logs a subject out.
private  void writeToFile(java.lang.String action)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_FILE_OPTION

public static final java.lang.String LOG_FILE_OPTION
See Also:
Constant Field Values

DATE_FORMAT

private static final java.text.DateFormat DATE_FORMAT

logFile

private java.io.File logFile

handler

private javax.security.auth.callback.CallbackHandler handler

username

private java.lang.String username
Constructor Detail

FileAuditLoginModule

public FileAuditLoginModule()
Method Detail

initialize

public void initialize(javax.security.auth.Subject subject,
                       javax.security.auth.callback.CallbackHandler callbackHandler,
                       java.util.Map sharedState,
                       java.util.Map options)
Description copied from interface: javax.security.auth.spi.LoginModule
Initializes this login module. This method is called when the instance implementing this interface is instantiated, and should perform any initialization based on the given parameters. Implementations should ignore state variables and options they do not recognize.

Specified by:
initialize in interface javax.security.auth.spi.LoginModule

login

public boolean login()
              throws javax.security.auth.login.LoginException
Description copied from interface: javax.security.auth.spi.LoginModule
Authenticates a subject to the system. This is the primary mechanism by which subjects are authenticated, and typically implementations will ask for credentials (for example, a user name and password) which will then be verified.

Specified by:
login in interface javax.security.auth.spi.LoginModule

writeToFile

private void writeToFile(java.lang.String action)

commit

public boolean commit()
               throws javax.security.auth.login.LoginException
Description copied from interface: javax.security.auth.spi.LoginModule
Commit the current login attempt. This is called after LoginModule.login()>LoginModule.login() 55 if the overall login attempt succeeds (that is, all methods have satisfied all REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL module requirements).

Specified by:
commit in interface javax.security.auth.spi.LoginModule

abort

public boolean abort()
              throws javax.security.auth.login.LoginException
Description copied from interface: javax.security.auth.spi.LoginModule
Abort the current login attempt. This is called after LoginModule.login()>LoginModule.login() 55 if the overall login attempt fails (that is, if one of the other login modules that is REQUIRED or REQUISITE fails). This method should clean up this module's saved state, if any.

Specified by:
abort in interface javax.security.auth.spi.LoginModule

logout

public boolean logout()
               throws javax.security.auth.login.LoginException
Description copied from interface: javax.security.auth.spi.LoginModule
Logs a subject out. This is primarily used for modules that must destroy or remove the authentication state associated with a logged-in subject.

Specified by:
logout in interface javax.security.auth.spi.LoginModule