net.sf.jguard.authentication.loginmodules
Class XmlLoginModule

java.lang.Object
  extended by net.sf.jguard.authentication.loginmodules.UserLoginModule
      extended by net.sf.jguard.authentication.loginmodules.XmlLoginModule
All Implemented Interfaces:
javax.security.auth.spi.LoginModule

public class XmlLoginModule
extends UserLoginModule
implements javax.security.auth.spi.LoginModule

LoginModule configured by the jGuardUsersPrincipals XML file.

Author:
Charles Gay

Field Summary
 
Fields inherited from class net.sf.jguard.authentication.loginmodules.UserLoginModule
callbackHandler, debug, login, options, password, sharedState, subject
 
Constructor Summary
XmlLoginModule()
           
 
Method Summary
 boolean commit()
          add Principals and Public/Private credentials to Subject.
 void initialize(javax.security.auth.Subject subj, javax.security.auth.callback.CallbackHandler cbkHandler, java.util.Map sState, java.util.Map opts)
          initialize the loginModule.
 boolean login()
          Authenticate the user.
 
Methods inherited from class net.sf.jguard.authentication.loginmodules.UserLoginModule
abort, getLogin, getPassword, logout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.security.auth.spi.LoginModule
abort, logout
 

Constructor Detail

XmlLoginModule

public XmlLoginModule()
Method Detail

initialize

public void initialize(javax.security.auth.Subject subj,
                       javax.security.auth.callback.CallbackHandler cbkHandler,
                       java.util.Map sState,
                       java.util.Map opts)
initialize the loginModule.

Specified by:
initialize in interface javax.security.auth.spi.LoginModule
Overrides:
initialize in class UserLoginModule
Parameters:
subject -
callbackHandler -
sharedState -
options -

login

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

Specified by:
login in interface javax.security.auth.spi.LoginModule
Returns:
true if the user is authenticated, false otherwise.
Throws:
javax.security.auth.login.FailedLoginException - authentication fails
javax.security.auth.login.LoginException - if this LoginModule is unable to perform the authentication.

commit

public boolean commit()
               throws javax.security.auth.login.LoginException
add Principals and Public/Private credentials to Subject.

Specified by:
commit in interface javax.security.auth.spi.LoginModule
Throws:
javax.security.auth.login.LoginException
See Also:
LoginModule.commit()