org.springframework.security.ldap.authentication
Class BindAuthenticator

java.lang.Object
  extended by org.springframework.security.ldap.authentication.AbstractLdapAuthenticator
      extended by org.springframework.security.ldap.authentication.BindAuthenticator
All Implemented Interfaces:
Aware, InitializingBean, MessageSourceAware, LdapAuthenticator

public class BindAuthenticator
extends AbstractLdapAuthenticator

An authenticator which binds as a user.

See Also:
AbstractLdapAuthenticator

Field Summary
 
Fields inherited from class org.springframework.security.ldap.authentication.AbstractLdapAuthenticator
messages
 
Constructor Summary
BindAuthenticator(BaseLdapPathContextSource contextSource)
          Create an initialized instance using the BaseLdapPathContextSource provided.
 
Method Summary
 DirContextOperations authenticate(Authentication authentication)
          Authenticates as a user and obtains additional user information from the directory.
protected  void handleBindException(String userDn, String username, Throwable cause)
          Allows subclasses to inspect the exception thrown by an attempt to bind with a particular DN.
 
Methods inherited from class org.springframework.security.ldap.authentication.AbstractLdapAuthenticator
afterPropertiesSet, getContextSource, getUserAttributes, getUserDns, getUserSearch, setMessageSource, setUserAttributes, setUserDnPatterns, setUserSearch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindAuthenticator

public BindAuthenticator(BaseLdapPathContextSource contextSource)
Create an initialized instance using the BaseLdapPathContextSource provided.

Parameters:
contextSource - the BaseLdapPathContextSource instance against which bind operations will be performed.
Method Detail

authenticate

public DirContextOperations authenticate(Authentication authentication)
Description copied from interface: LdapAuthenticator
Authenticates as a user and obtains additional user information from the directory.

Returns:
the details of the successfully authenticated user.

handleBindException

protected void handleBindException(String userDn,
                                   String username,
                                   Throwable cause)
Allows subclasses to inspect the exception thrown by an attempt to bind with a particular DN. The default implementation just reports the failure to the debug logger.