Upgraded to WSS4J 1.6.15
This commit is contained in:
@@ -223,7 +223,7 @@ project('spring-ws-security') {
|
||||
optional("com.sun.xml.wss:xws-security:3.0") {
|
||||
exclude group: 'javax.xml.crypto', module: 'xmldsig'
|
||||
}
|
||||
optional("org.apache.ws.security:wss4j:1.6.5")
|
||||
optional("org.apache.ws.security:wss4j:1.6.15")
|
||||
|
||||
// SOAP
|
||||
provided("com.sun.xml.messaging.saaj:saaj-impl:1.3.19") // required for XWSS
|
||||
|
||||
@@ -564,6 +564,8 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl
|
||||
|
||||
requestData.setWssConfig(wssConfig);
|
||||
|
||||
messageContext.setProperty(WSHandlerConstants.TTL_TIMESTAMP, Integer.toString(securementTimeToLive));
|
||||
|
||||
return requestData;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,9 +70,18 @@ public abstract class Wss4jMessageInterceptorSpringSecurityCallbackHandlerTestCa
|
||||
|
||||
@Test
|
||||
public void testValidateUsernameTokenDigest() throws Exception {
|
||||
EndpointInterceptor interceptor = prepareInterceptor("UsernameToken", true, true);
|
||||
SoapMessage message = loadSoap11Message("usernameTokenDigest-soap.xml");
|
||||
Wss4jSecurityInterceptor interceptor = new Wss4jSecurityInterceptor();
|
||||
interceptor.setSecurementActions("UsernameToken");
|
||||
interceptor.setSecurementUsername("Bert");
|
||||
interceptor.setSecurementPassword("Ernie");
|
||||
interceptor.setSecurementPasswordType(WSConstants.PW_DIGEST);
|
||||
|
||||
|
||||
SoapMessage message = loadSoap11Message("empty-soap.xml");
|
||||
MessageContext messageContext = new DefaultMessageContext(message, getSoap11MessageFactory());
|
||||
interceptor.handleRequest(messageContext);
|
||||
|
||||
interceptor = prepareInterceptor("UsernameToken", true, true);
|
||||
interceptor.handleRequest(messageContext, null);
|
||||
assertValidateUsernameToken(message);
|
||||
|
||||
@@ -91,7 +100,7 @@ public abstract class Wss4jMessageInterceptorSpringSecurityCallbackHandlerTestCa
|
||||
assertNotNull("No Authentication created", SecurityContextHolder.getContext().getAuthentication());
|
||||
}
|
||||
|
||||
protected EndpointInterceptor prepareInterceptor(String actions, boolean validating, boolean digest)
|
||||
protected Wss4jSecurityInterceptor prepareInterceptor(String actions, boolean validating, boolean digest)
|
||||
throws Exception {
|
||||
Wss4jSecurityInterceptor interceptor = new Wss4jSecurityInterceptor();
|
||||
if (validating) {
|
||||
|
||||
@@ -49,9 +49,17 @@ public abstract class Wss4jMessageInterceptorUsernameTokenTestCase extends Wss4j
|
||||
|
||||
@Test
|
||||
public void testValidateUsernameTokenDigest() throws Exception {
|
||||
Wss4jSecurityInterceptor interceptor = prepareInterceptor("UsernameToken", true, true);
|
||||
SoapMessage message = loadSoap11Message("usernameTokenDigest-soap.xml");
|
||||
Wss4jSecurityInterceptor interceptor = new Wss4jSecurityInterceptor();
|
||||
interceptor.setSecurementActions("UsernameToken");
|
||||
interceptor.setSecurementUsername("Bert");
|
||||
interceptor.setSecurementPassword("Ernie");
|
||||
interceptor.setSecurementPasswordType(WSConstants.PW_DIGEST);
|
||||
|
||||
SoapMessage message = loadSoap11Message("empty-soap.xml");
|
||||
MessageContext messageContext = new DefaultMessageContext(message, getSoap11MessageFactory());
|
||||
interceptor.handleRequest(messageContext);
|
||||
|
||||
interceptor = prepareInterceptor("UsernameToken", true, true);
|
||||
interceptor.validateMessage(message, messageContext);
|
||||
assertValidateUsernameToken(message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user