Class BindAuthenticator
java.lang.Object
org.springframework.security.ldap.authentication.AbstractLdapAuthenticator
org.springframework.security.ldap.authentication.BindAuthenticator
- All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware, LdapAuthenticator
An authenticator which binds as a user.
- See Also:
-
Field Summary
Fields inherited from class AbstractLdapAuthenticator
messages -
Constructor Summary
ConstructorsConstructorDescriptionBindAuthenticator(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource) Create an initialized instance using theBaseLdapPathContextSourceprovided. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.ldap.core.DirContextOperationsauthenticate(Authentication authentication) Authenticates as a user and obtains additional user information from the directory.protected voidhandleBindException(String userDn, String username, Throwable cause) Allows subclasses to inspect the exception thrown by an attempt to bind with a particular DN.voidsetAlsoHandleJavaxNamingBindExceptions(boolean alsoHandleJavaxNamingBindExceptions) Set whether javax-based bind exceptions should also be delegated to#handleBindException(only Spring-based bind exceptions are handled by default)Methods inherited from class AbstractLdapAuthenticator
afterPropertiesSet, getContextSource, getUserAttributes, getUserDns, getUserSearch, setMessageSource, setUserAttributes, setUserDnPatterns, setUserSearch
-
Constructor Details
-
BindAuthenticator
public BindAuthenticator(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource) Create an initialized instance using theBaseLdapPathContextSourceprovided.- Parameters:
contextSource- the BaseLdapPathContextSource instance against which bind operations will be performed.
-
-
Method Details
-
authenticate
public org.springframework.ldap.core.DirContextOperations authenticate(Authentication authentication) Description copied from interface:LdapAuthenticatorAuthenticates as a user and obtains additional user information from the directory.- Parameters:
authentication- the authentication request- Returns:
- the details of the successfully authenticated user.
-
handleBindException
-
setAlsoHandleJavaxNamingBindExceptions
public void setAlsoHandleJavaxNamingBindExceptions(boolean alsoHandleJavaxNamingBindExceptions) Set whether javax-based bind exceptions should also be delegated to#handleBindException(only Spring-based bind exceptions are handled by default)For passivity reasons, defaults to
false, though may change totruein future releases.- Parameters:
alsoHandleJavaxNamingBindExceptions- - whether to delegate javax-based bind exceptions to #handleBindException- Since:
- 6.4
-