com.hs.mail.security.login
Class BasicLoginModule

java.lang.Object
  extended by com.hs.mail.security.login.BasicLoginModule
All Implemented Interfaces:
LoginModule
Direct Known Subclasses:
JdbcLoginModule, JndiLoginModule, PropertiesLoginModule

public abstract class BasicLoginModule
extends Object
implements LoginModule

Base class for custom LoginModule.

Since:
Jul 18, 2007
Author:
Won Chul Doh

Field Summary
protected  CallbackHandler callbackHandler
          A CallbackHandler for communicating with the end user (prompting for usernames and passwords, for example).
protected  boolean commitSuccess
          The commit status.
protected  boolean debug
           
protected  Class encoder
          Class for password encoder
protected  Map options
          Options specified in the login Configuration for this particular LoginModule.
protected  Principal[] principals
          The Principals authenticated.
protected  Map sharedState
          State shared with other configured LoginModules.
protected  Subject subject
          The Subject to be authenticated.
protected  boolean success
          The authentication status.
 
Constructor Summary
protected BasicLoginModule()
           
 
Method Summary
 boolean abort()
          Standard JAAS override.
protected  boolean checkPassword(String encoded, char[] plain)
           
 boolean commit()
          Overriding to complete login process.
protected  Callback[] getDefaultCallbacks()
           
protected  String getOption(String name, String defaultValue)
           
 void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
          Overriding to allow for proper initialization.
 boolean login()
          Overriding to allow for certificate-based login.
 boolean logout()
          Standard JAAS override.
protected abstract  Principal[] validate(Callback[] callbacks)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

success

protected boolean success
The authentication status.


commitSuccess

protected boolean commitSuccess
The commit status.


subject

protected Subject subject
The Subject to be authenticated.


principals

protected Principal[] principals
The Principals authenticated.


callbackHandler

protected CallbackHandler callbackHandler
A CallbackHandler for communicating with the end user (prompting for usernames and passwords, for example).


sharedState

protected Map sharedState
State shared with other configured LoginModules.


options

protected Map options
Options specified in the login Configuration for this particular LoginModule.


encoder

protected Class encoder
Class for password encoder


debug

protected boolean debug
Constructor Detail

BasicLoginModule

protected BasicLoginModule()
Method Detail

initialize

public void initialize(Subject subject,
                       CallbackHandler callbackHandler,
                       Map<String,?> sharedState,
                       Map<String,?> options)
Overriding to allow for proper initialization. Standard JAAS.

Specified by:
initialize in interface LoginModule

login

public boolean login()
              throws LoginException
Overriding to allow for certificate-based login. Standard JAAS.

Specified by:
login in interface LoginModule
Throws:
LoginException

logout

public boolean logout()
               throws LoginException
Standard JAAS override.

Specified by:
logout in interface LoginModule
Throws:
LoginException

abort

public boolean abort()
              throws LoginException
Standard JAAS override.

Specified by:
abort in interface LoginModule
Throws:
LoginException

commit

public boolean commit()
               throws LoginException
Overriding to complete login process. Standard JAAS.

Specified by:
commit in interface LoginModule
Throws:
LoginException

checkPassword

protected boolean checkPassword(String encoded,
                                char[] plain)
                         throws LoginException
Throws:
LoginException

validate

protected abstract Principal[] validate(Callback[] callbacks)
                                 throws LoginException
Throws:
LoginException

getDefaultCallbacks

protected Callback[] getDefaultCallbacks()

getOption

protected String getOption(String name,
                           String defaultValue)


Copyright © 2011. All Rights Reserved.