Class LdapAuthenticationProvider

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.context.MessageSourceAware, org.springframework.security.authentication.AuthenticationProvider

    public class LdapAuthenticationProvider
    extends org.springframework.security.ldap.authentication.LdapAuthenticationProvider
    Since spring security 3.2.0, internal authentication exception stops the authentication: https://jira.spring.io/browse/SEC-2367. But if LDAP authentication fails due to LDAP communication issue, we want to try internal authentication.
    • Field Summary

      • Fields inherited from class org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider

        logger, messages, userDetailsContextMapper
    • Constructor Summary

      Constructors 
      Constructor Description
      LdapAuthenticationProvider​(org.springframework.security.ldap.authentication.LdapAuthenticator authenticator)  
      LdapAuthenticationProvider​(org.springframework.security.ldap.authentication.LdapAuthenticator authenticator, org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator authoritiesPopulator)  
      LdapAuthenticationProvider​(org.springframework.security.ldap.authentication.LdapAuthenticator authenticator, org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator authoritiesPopulator, LdapGroupEmailProvider groupEmailProvider)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.security.core.Authentication authenticate​(org.springframework.security.core.Authentication authentication)  
      java.lang.String getExternalIdAttribute()  
      LdapGroupEmailProvider getGroupEmailProvider()  
      void setExternalIdAttribute​(java.lang.String externalIdAttribute)  
      • Methods inherited from class org.springframework.security.ldap.authentication.LdapAuthenticationProvider

        doAuthentication, getAuthoritiesPopulator, loadUserAuthorities, setHideUserNotFoundExceptions
      • Methods inherited from class org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider

        createSuccessfulAuthentication, getUserDetailsContextMapper, setAuthoritiesMapper, setMessageSource, setUseAuthenticationRequestCredentials, setUserDetailsContextMapper, supports
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LdapAuthenticationProvider

        public LdapAuthenticationProvider​(org.springframework.security.ldap.authentication.LdapAuthenticator authenticator,
                                          org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator authoritiesPopulator,
                                          LdapGroupEmailProvider groupEmailProvider)
      • LdapAuthenticationProvider

        public LdapAuthenticationProvider​(org.springframework.security.ldap.authentication.LdapAuthenticator authenticator,
                                          org.springframework.security.ldap.userdetails.LdapAuthoritiesPopulator authoritiesPopulator)
      • LdapAuthenticationProvider

        public LdapAuthenticationProvider​(org.springframework.security.ldap.authentication.LdapAuthenticator authenticator)
    • Method Detail

      • authenticate

        public org.springframework.security.core.Authentication authenticate​(org.springframework.security.core.Authentication authentication)
                                                                      throws org.springframework.security.core.AuthenticationException
        Specified by:
        authenticate in interface org.springframework.security.authentication.AuthenticationProvider
        Overrides:
        authenticate in class org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider
        Throws:
        org.springframework.security.core.AuthenticationException
      • getExternalIdAttribute

        public java.lang.String getExternalIdAttribute()
      • setExternalIdAttribute

        public void setExternalIdAttribute​(java.lang.String externalIdAttribute)