Class AbstractLdapAuthenticator
java.lang.Object
org.springframework.security.ldap.authentication.AbstractLdapAuthenticator
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware,- org.springframework.beans.factory.InitializingBean,- org.springframework.context.MessageSourceAware,- LdapAuthenticator
- Direct Known Subclasses:
- BindAuthenticator,- PasswordComparisonAuthenticator
public abstract class AbstractLdapAuthenticator
extends Object
implements LdapAuthenticator, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware
Base class for the authenticator implementations.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected org.springframework.context.support.MessageSourceAccessor
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractLdapAuthenticator(org.springframework.ldap.core.ContextSource contextSource) Create an initialized instance with theContextSourceprovided.
- 
Method SummaryModifier and TypeMethodDescriptionvoidprotected org.springframework.ldap.core.ContextSourceString[]getUserDns(String username) Builds list of possible DNs for the user, worked out from the userDnPatterns property.protected LdapUserSearchvoidsetMessageSource(org.springframework.context.MessageSource messageSource) voidsetUserAttributes(String[] userAttributes) Sets the user attributes which will be retrieved from the directory.voidsetUserDnPatterns(String[] dnPattern) Sets the pattern which will be used to supply a DN for the user.voidsetUserSearch(LdapUserSearch userSearch) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.ldap.authentication.LdapAuthenticatorauthenticate
- 
Field Details- 
messagesprotected org.springframework.context.support.MessageSourceAccessor messages
 
- 
- 
Constructor Details- 
AbstractLdapAuthenticatorpublic AbstractLdapAuthenticator(org.springframework.ldap.core.ContextSource contextSource) Create an initialized instance with theContextSourceprovided.- Parameters:
- contextSource- the- ContextSourceto use
 
 
- 
- 
Method Details- 
afterPropertiesSetpublic void afterPropertiesSet()- Specified by:
- afterPropertiesSetin interface- org.springframework.beans.factory.InitializingBean
 
- 
getContextSourceprotected org.springframework.ldap.core.ContextSource getContextSource()
- 
getUserAttributes
- 
getUserDnsBuilds list of possible DNs for the user, worked out from the userDnPatterns property.- Parameters:
- username- the user's login name
- Returns:
- the list of possible DN matches, empty if userDnPatterns wasn't set.
 
- 
getUserSearch
- 
setMessageSourcepublic void setMessageSource(@NonNull org.springframework.context.MessageSource messageSource) - Specified by:
- setMessageSourcein interface- org.springframework.context.MessageSourceAware
 
- 
setUserAttributesSets the user attributes which will be retrieved from the directory.- Parameters:
- userAttributes- the set of user attributes to retrieve
 
- 
setUserDnPatternsSets the pattern which will be used to supply a DN for the user. The pattern should be the name relative to the root DN. The pattern argument {0} will contain the username. An example would be "cn={0},ou=people".- Parameters:
- dnPattern- the array of patterns which will be tried when converting a username to a DN.
 
- 
setUserSearch
 
-