title: Spring Security - Authenticate Users With Active Directory against LDAP in Spring Boot
body: <p>I am gettting LDAP authentication error when we configured for LDAP authentication. My property files as below configuration:</p>
  
  <pre><code> ldap.urls=ldap://***.***.local:8389
      ldap.base.dn=dc=test,dc=com
      ldap.user.dn.pattern=(&amp;(objectClass=user)(userPrincipalName={0})(memberof=CN=Group Name,OU=***,OU=****,DC=test,DC=com))
  </code></pre>
  
  <p>While accessing wsdl by passing valid username &amp; password getting below error:</p>
  
  <p><code>While accessing wsdl it is asking username &amp; Password. If we provided then it saying that “ActiveDirectoryLdapAuthenticationProvider - Active Directory authentication failed: Supplied password was invalid</code></p>
  
  <p>and while starting the application i am able to see below log on console:</p>
  
  <pre><code>`org.springframework.ldap.core.support.AbstractContextSource - Property 'userDn' not set - anonymous context will be used for read-write operation`
  </code></pre>
  
  <p>for SOAP Calls as i have provided some more in SOAPWebServiceConfig.java even not working.</p>
  
  <pre><code>//XwsSecurityInterceptor
      @Bean
      public XwsSecurityInterceptor securityInterceptor(){
          XwsSecurityInterceptor securityInterceptor = new XwsSecurityInterceptor();
          //Callback Handler -&gt; SimplePasswordValidationCallbackHandler
          securityInterceptor.setCallbackHandler(callbackHandler());
          //Security Policy -&gt; securityPolicy.xml
          securityInterceptor.setPolicyConfiguration(new ClassPathResource("securityPolicy.xml"));
          return securityInterceptor;
      }
  
      @Bean
      public SimplePasswordValidationCallbackHandler callbackHandler() {
          SimplePasswordValidationCallbackHandler handler = new SimplePasswordValidationCallbackHandler();
          handler.setUsersMap(Collections.singletonMap("user", "password"));
          return handler;
      }
  
      //Interceptors.add -&gt; XwsSecurityInterceptor
      @Override
      public void addInterceptors(List&lt;EndpointInterceptor&gt; interceptors) {
          interceptors.add(securityInterceptor());
      }
  </code></pre>
  
  <p>I am not getting what is the issue here. Can anyone please suggest on this.</p>