com.hs.mail.security.login
Class JndiLoginModule

java.lang.Object
  extended by com.hs.mail.security.login.BasicLoginModule
      extended by com.hs.mail.security.login.JndiLoginModule
All Implemented Interfaces:
LoginModule

public class JndiLoginModule
extends BasicLoginModule

A LoginModule that allows for authentication based on LDAP directory.

Since:
Aug 7, 2010
Author:
Won Chul Doh

Field Summary
protected  DirContext context
           
 
Fields inherited from class com.hs.mail.security.login.BasicLoginModule
callbackHandler, commitSuccess, debug, encoder, options, principals, sharedState, subject, success
 
Constructor Summary
JndiLoginModule()
           
 
Method Summary
protected  boolean authenticate(String username, String password)
           
protected  void close(DirContext context)
           
 void initialize(Subject subject, CallbackHandler callbackHandler, Map<String,?> sharedState, Map<String,?> options)
          Overriding to allow for proper initialization.
protected  DirContext open()
           
protected  Principal[] validate(Callback[] callbacks)
           
 
Methods inherited from class com.hs.mail.security.login.BasicLoginModule
abort, checkPassword, commit, getDefaultCallbacks, getOption, login, logout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

protected DirContext context
Constructor Detail

JndiLoginModule

public JndiLoginModule()
Method Detail

initialize

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

Specified by:
initialize in interface LoginModule
Overrides:
initialize in class BasicLoginModule

validate

protected Principal[] validate(Callback[] callbacks)
                        throws LoginException
Specified by:
validate in class BasicLoginModule
Throws:
LoginException

authenticate

protected boolean authenticate(String username,
                               String password)
                        throws Exception
Throws:
Exception

open

protected DirContext open()
                   throws NamingException
Throws:
NamingException

close

protected void close(DirContext context)


Copyright © 2011. All Rights Reserved.