Spring Security Framework

org.springframework.security.ui.ntlm.ldap.authenticator
Class NtlmAwareLdapAuthenticator

java.lang.Object
  extended by org.springframework.security.providers.ldap.authenticator.AbstractLdapAuthenticator
      extended by org.springframework.security.providers.ldap.authenticator.BindAuthenticator
          extended by org.springframework.security.ui.ntlm.ldap.authenticator.NtlmAwareLdapAuthenticator
All Implemented Interfaces:
InitializingBean, MessageSourceAware, LdapAuthenticator

public class NtlmAwareLdapAuthenticator
extends BindAuthenticator

Loads the UserDetails if authentication was already performed by NTLM (indicated by the type of authentication token submitted). Otherwise falls back to the parent class behaviour, attempting to bind as the user.

Author:
sylvain.mougenot

Field Summary
 
Fields inherited from class org.springframework.security.providers.ldap.authenticator.AbstractLdapAuthenticator
messages
 
Constructor Summary
NtlmAwareLdapAuthenticator(SpringSecurityContextSource contextSource)
           
 
Method Summary
 org.springframework.ldap.core.DirContextOperations authenticate(Authentication authentication)
          If the supplied Authentication object is of type NtlmUsernamePasswordAuthenticationToken, the information stored in the user's directory entry is loaded without attempting to authenticate them.
protected  org.springframework.ldap.core.DirContextOperations loadUser(String aUserDn, String aUserName)
          Loads the user context information without binding.
 
Methods inherited from class org.springframework.security.providers.ldap.authenticator.BindAuthenticator
handleBindException
 
Methods inherited from class org.springframework.security.providers.ldap.authenticator.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

NtlmAwareLdapAuthenticator

public NtlmAwareLdapAuthenticator(SpringSecurityContextSource contextSource)
Method Detail

loadUser

protected org.springframework.ldap.core.DirContextOperations loadUser(String aUserDn,
                                                                      String aUserName)
Loads the user context information without binding.


authenticate

public org.springframework.ldap.core.DirContextOperations authenticate(Authentication authentication)
If the supplied Authentication object is of type NtlmUsernamePasswordAuthenticationToken, the information stored in the user's directory entry is loaded without attempting to authenticate them. Otherwise the parent class is called to perform a bind operation to authenticate the user.

Specified by:
authenticate in interface LdapAuthenticator
Overrides:
authenticate in class BindAuthenticator
Returns:
the details of the successfully authenticated user.

Spring Security Framework

Copyright © 2004-2010 SpringSource, Inc. All Rights Reserved.