Spring Security 4.0.0 + ActiveDirectoryLdapAuthenticationProvider + BadCredentialsException PartialResultException

前端 未结 3 1894
温柔的废话
温柔的废话 2020-12-31 07:01

I have read almost everything about Spring/Security/Ldap and ActiveDirectory on stackoverflow. Even if I found useful tips and hints, I wasn\'t able to solve my problem.

3条回答
  •  别那么骄傲
    2020-12-31 07:31

    In Spring Security 4.1.1 / SpringBoot 1.4.0 environment, I do this like that (in Java):

    @Configuration
    public class AuthenticationConfiguration extends GlobalAuthenticationConfigurerAdapter
    {
       public void init (AuthenticationManagerBuilder aAuth) throws Exception
       {
    
          ActiveDirectoryLdapAuthenticationProvider
                  myProvider = new ActiveDirectoryLdapAuthenticationProvider (ldapDomain, ldapUrl);
          aAuth.authenticationProvider (myProvider);
          aAuth.eraseCredentials (false);
       }
    }
    

    I don't run into any problem and the user can logon using the sAMAccountName.

提交回复
热议问题