Class 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 java.lang.Object
    implements LdapAuthenticator, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware
    Base class for the authenticator implementations.
    • Field Summary

      Modifier and Type Field Description
      protected messages  
    • Constructor Summary

      Constructor Description
      AbstractLdapAuthenticator​(org.springframework.ldap.core.ContextSource contextSource)
      Create an initialized instance with the ContextSource provided.
    • Field Detail

      • messages

        protected messages
    • Constructor Detail

      • AbstractLdapAuthenticator

        public AbstractLdapAuthenticator​(org.springframework.ldap.core.ContextSource contextSource)
        Create an initialized instance with the ContextSource provided.
        contextSource -
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      • getContextSource

        protected org.springframework.ldap.core.ContextSource getContextSource()
      • getUserAttributes

        public java.lang.String[] getUserAttributes()
      • getUserDns

        protected java.util.List<java.lang.String> getUserDns​(java.lang.String username)
        Builds list of possible DNs for the user, worked out from the userDnPatterns property.
        username - the user's login name
        the list of possible DN matches, empty if userDnPatterns wasn't set.
      • setMessageSource

        public void setMessageSource​(org.springframework.context.MessageSource messageSource)
        Specified by:
        setMessageSource in interface org.springframework.context.MessageSourceAware
      • setUserAttributes

        public void setUserAttributes​(java.lang.String[] userAttributes)
        Sets the user attributes which will be retrieved from the directory.
        userAttributes -
      • setUserDnPatterns

        public void setUserDnPatterns​(java.lang.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".
        dnPattern - the array of patterns which will be tried when converting a username to a DN.
      • setUserSearch

        public void setUserSearch​(LdapUserSearch userSearch)