title: Basic authentication doesn't work for SOAP Web Service with Active Directory LDAP in Spring Boot
body: <p>The HTTP Basic Authentication is failing while testing the SOAP Request from SOAP UI but working when trying to access the wsdl from Web Browser.</p>
  
  <p>I have added the Authentication details in SOAP UI also under Authentication tab with details as shown below:</p>
  
  <ol>
  <li>Authorization Type  : Global HTTP Basic </li>
  <li>Username : **** </li>
  <li>Password : **** </li>
  <li>Domain: test.com //here the domain given which has configured in LDAP Config</li>
  </ol>
  
  <p>Getting below error logs on consoile while testing from SOAP UI:</p>
  
  <pre><code>Getting " ExceptionTranslationFilter - Access is denied (user is anonymous); redirecting to authentication entry point 
  org.springframework.security.access.AccessDeniedException: Access is denied 
  " 
  [DEBUG] 2018-08-28 12:08:33.070 [http-nio-36454-exec-3] AndRequestMatcher - Trying to match using Ant [pattern='/**', GET] 
  [DEBUG] 2018-08-28 12:08:33.070 [http-nio-36454-exec-3] AntPathRequestMatcher - Request 'POST /error' doesn't match 'GET /** 
  [DEBUG] 2018-08-28 12:08:33.070 [http-nio-36454-exec-3] AndRequestMatcher - Did not match 
  [DEBUG] 2018-08-28 12:08:33.070 [http-nio-36454-exec-3] HttpSessionRequestCache - Request not saved as configured RequestMatcher did not 
  </code></pre>
  
  <h1> Config() as shown below:</h1>
  
  <pre><code>@Override
      protected void configure(HttpSecurity http) throws Exception {
  
          http.authorizeRequests().anyRequest().fullyAuthenticated().and().httpBasic().authenticationEntryPoint(authEntryPoint);
  
          http.exceptionHandling().authenticationEntryPoint(authEntryPoint);
  
      }
  </code></pre>
  
  <p>Anything need to be add in <code>WsConfigurerAdapter</code> class  apart from defaultWsdl11Definition for SOAP Web service call to Authenticate in Spring Boot?</p>
  
  <p>and also added the below code in SOAPWebServiceConfig.java:</p>
  
  <pre><code>@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>Can anyone please help on this.</p>