public abstract class

AbstractLdapAuthenticator

extends Object
implements InitializingBean MessageSourceAware LdapAuthenticator
java.lang.Object
   ↳ org.springframework.security.ldap.authentication.AbstractLdapAuthenticator
Known Direct Subclasses

Class Overview

Base class for the authenticator implementations.

Summary

Fields
protected MessageSourceAccessor messages
Public Constructors
AbstractLdapAuthenticator(ContextSource contextSource)
Create an initialized instance with the ContextSource provided.
Public Methods
void afterPropertiesSet()
String[] getUserAttributes()
void setMessageSource(MessageSource messageSource)
void setUserAttributes(String[] userAttributes)
Sets the user attributes which will be retrieved from the directory.
void setUserDnPatterns(String[] dnPattern)
Sets the pattern which will be used to supply a DN for the user.
void setUserSearch(LdapUserSearch userSearch)
Protected Methods
ContextSource getContextSource()
List<String> getUserDns(String username)
Builds list of possible DNs for the user, worked out from the userDnPatterns property.
LdapUserSearch getUserSearch()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.factory.InitializingBean
From interface org.springframework.context.MessageSourceAware
From interface org.springframework.security.ldap.authentication.LdapAuthenticator

Fields

protected MessageSourceAccessor messages

Public Constructors

public AbstractLdapAuthenticator (ContextSource contextSource)

Create an initialized instance with the ContextSource provided.

Public Methods

public void afterPropertiesSet ()

Throws
Exception

public String[] getUserAttributes ()

public void setMessageSource (MessageSource messageSource)

public void setUserAttributes (String[] userAttributes)

Sets the user attributes which will be retrieved from the directory.

public void setUserDnPatterns (String[] dnPattern)

Sets 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.

public void setUserSearch (LdapUserSearch userSearch)

Protected Methods

protected ContextSource getContextSource ()

protected List<String> getUserDns (String username)

Builds 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.

protected LdapUserSearch getUserSearch ()