Search in sources :

Example 1 with Wss4jSecurityInterceptor

use of org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor in project citrus-samples by christophd.

the class EndpointConfig method wss4jSecurityServerInterceptor.

@Bean
public Wss4jSecurityInterceptor wss4jSecurityServerInterceptor() {
    Wss4jSecurityInterceptor interceptor = new Wss4jSecurityInterceptor();
    interceptor.setValidationActions("Timestamp UsernameToken");
    SimplePasswordValidationCallbackHandler validationCallbackHandler = new SimplePasswordValidationCallbackHandler();
    validationCallbackHandler.setUsersMap(Collections.singletonMap("admin", "secret"));
    interceptor.setValidationCallbackHandler(validationCallbackHandler);
    return interceptor;
}
Also used : Wss4jSecurityInterceptor(org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor) SimplePasswordValidationCallbackHandler(org.springframework.ws.soap.security.wss4j2.callback.SimplePasswordValidationCallbackHandler) Bean(org.springframework.context.annotation.Bean)

Example 2 with Wss4jSecurityInterceptor

use of org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor in project camel by apache.

the class ProducerWss4JSecurityHeaderTest method setRemoveHeaders.

private void setRemoveHeaders(boolean isRemoved) {
    ClientInterceptor[] clientInterceptors = webServiceTemplate.getInterceptors();
    for (int i = 0; i < clientInterceptors.length; i++) {
        if (clientInterceptors[i] instanceof Wss4jSecurityInterceptor) {
            Wss4jSecurityInterceptor wss4jSampleInterceptor = (Wss4jSecurityInterceptor) clientInterceptors[i];
            wss4jSampleInterceptor.setRemoveSecurityHeader(isRemoved);
        }
    }
}
Also used : Wss4jSecurityInterceptor(org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor) ClientInterceptor(org.springframework.ws.client.support.interceptor.ClientInterceptor)

Example 3 with Wss4jSecurityInterceptor

use of org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor in project citrus-samples by christophd.

the class EndpointConfig method wss4jSecurityClientInterceptor.

@Bean
public Wss4jSecurityInterceptor wss4jSecurityClientInterceptor() {
    Wss4jSecurityInterceptor interceptor = new Wss4jSecurityInterceptor();
    interceptor.setSecurementActions("Timestamp UsernameToken");
    interceptor.setSecurementUsername("admin");
    interceptor.setSecurementPassword("secret");
    return interceptor;
}
Also used : Wss4jSecurityInterceptor(org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor) Bean(org.springframework.context.annotation.Bean)

Aggregations

Wss4jSecurityInterceptor (org.springframework.ws.soap.security.wss4j2.Wss4jSecurityInterceptor)3 Bean (org.springframework.context.annotation.Bean)2 ClientInterceptor (org.springframework.ws.client.support.interceptor.ClientInterceptor)1 SimplePasswordValidationCallbackHandler (org.springframework.ws.soap.security.wss4j2.callback.SimplePasswordValidationCallbackHandler)1