Обычная проверка подлинности не работает для веб-службы SOAP с Active Directory LDAP в Spring Boot

Ошибка базовой аутентификации HTTP при тестировании запроса SOAP из пользовательского интерфейса SOAP, но работает при попытке доступа к wsdl из веб-браузера.

Я добавил сведения об аутентификации в пользовательском интерфейсе SOAP также на вкладке «Аутентификация» с подробностями, как показано ниже:

  1. Тип авторизации: глобальная базовая HTTP
  2. Имя пользователя : ****
  3. Пароль : ****
  4. Домен: test.com // здесь указан домен, настроенный в LDAP Config

Получение ниже журналов ошибок на консоли при тестировании из пользовательского интерфейса SOAP:

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 

Config(), как показано ниже:

@Override
    protected void configure(HttpSecurity http) throws Exception {

        http.authorizeRequests().anyRequest().fullyAuthenticated().and().httpBasic().authenticationEntryPoint(authEntryPoint);

        http.exceptionHandling().authenticationEntryPoint(authEntryPoint);

    }

Что-нибудь нужно добавить в класс WsConfigurerAdapter, кроме defaultWsdl11Definition для вызова веб-службы SOAP для аутентификации в Spring Boot?

а также добавил приведенный ниже код в SOAPWebServiceConfig.java:

@Bean
    public XwsSecurityInterceptor securityInterceptor(){
        XwsSecurityInterceptor securityInterceptor = new XwsSecurityInterceptor();
        //Callback Handler -> SimplePasswordValidationCallbackHandler
        securityInterceptor.setCallbackHandler(callbackHandler());
        //Security Policy -> 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 -> XwsSecurityInterceptor
    @Override
    public void addInterceptors(List<EndpointInterceptor> interceptors) {
        interceptors.add(securityInterceptor());
    }

Может ли кто-нибудь помочь в этом.


person Rajeswari Reddy    schedule 28.08.2018    source источник