Repository: cxf
Updated Branches:
refs/heads/3.0.x-fixes f515eb1e3 -> c3bb80b0c
Fix SAML Audience Restriction problem with JMS
Conflicts:
systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/JMSWSSecurityTest.java
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/161cab50
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/161cab50
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/161cab50
Branch: refs/heads/3.0.x-fixes
Commit: 161cab50b789c277db2460e3e3be9dff00f42fba
Parents: f515eb1
Author: Colm O hEigeartaigh <[email protected]>
Authored: Wed Nov 11 10:58:29 2015 +0000
Committer: Colm O hEigeartaigh <[email protected]>
Committed: Wed Nov 11 12:06:04 2015 +0000
----------------------------------------------------------------------
.../java/org/apache/cxf/transport/jms/JMSMessageUtils.java | 4 +++-
.../org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java | 2 +-
.../org/apache/cxf/systest/jms/security/JMSWSSecurityTest.java | 6 +++++-
3 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/161cab50/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java
----------------------------------------------------------------------
diff --git
a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java
index f5e6e9c..4f16cf3 100644
---
a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java
+++
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSMessageUtils.java
@@ -153,7 +153,6 @@ final class JMSMessageUtils {
inMessage.put(org.apache.cxf.message.Message.PROTOCOL_HEADERS,
protHeaders);
populateIncomingMessageProperties(message, inMessage,
messageProperties);
-
}
/**
@@ -208,6 +207,9 @@ final class JMSMessageUtils {
headers.put(JMSSpecConstants.TARGET_SERVICE_IN_REQUESTURI,
Collections.singletonList("true"));
}
+ if (requestURI != null) {
+ inMessage.put(org.apache.cxf.message.Message.REQUEST_URI,
requestURI);
+ }
} catch (Exception e) {
headers.put(JMSSpecConstants.MALFORMED_REQUESTURI,
Collections.singletonList("true"));
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/161cab50/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
----------------------------------------------------------------------
diff --git
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
index ed90380..4476fae 100644
---
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
+++
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
@@ -352,7 +352,7 @@ public class WSS4JInInterceptor extends
AbstractWSS4JInterceptor {
if (msg.get(org.apache.cxf.message.Message.REQUEST_URL) != null) {
audiences.add((String)msg.getContextualProperty(org.apache.cxf.message.Message.REQUEST_URL));
} else if (msg.get(org.apache.cxf.message.Message.REQUEST_URI) !=
null) {
-
audiences.add((String)msg.get(org.apache.cxf.message.Message.REQUEST_URL));
+
audiences.add((String)msg.get(org.apache.cxf.message.Message.REQUEST_URI));
}
if (msg.getContextualProperty("javax.xml.ws.wsdl.service") !=
null) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/161cab50/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/JMSWSSecurityTest.java
----------------------------------------------------------------------
diff --git
a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/JMSWSSecurityTest.java
b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/JMSWSSecurityTest.java
index f5a3b47..6e18447 100644
---
a/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/JMSWSSecurityTest.java
+++
b/systests/transport-jms/src/test/java/org/apache/cxf/systest/jms/security/JMSWSSecurityTest.java
@@ -112,7 +112,6 @@ public class JMSWSSecurityTest extends
AbstractBusClientServerTestBase {
}
@Test
- @org.junit.Ignore
public void testUnsignedSAML2AudienceRestrictionToken() throws Exception {
QName serviceName = new QName("http://cxf.apache.org/hello_world_jms",
"HelloWorldService");
QName portName = new QName("http://cxf.apache.org/hello_world_jms",
"HelloWorldPort");
@@ -128,8 +127,13 @@ public class JMSWSSecurityTest extends
AbstractBusClientServerTestBase {
ConditionsBean conditions = new ConditionsBean();
conditions.setTokenPeriodMinutes(5);
+<<<<<<< HEAD
List<String> audiences = new ArrayList<String>();
audiences.add("http://apache.org/one");
+=======
+ List<String> audiences = new ArrayList<>();
+ audiences.add("jms:jndi:dynamicQueues/test.jmstransport.text");
+>>>>>>> e7d7190... Fix SAML Audience Restriction problem with JMS
AudienceRestrictionBean audienceRestrictionBean = new
AudienceRestrictionBean();
audienceRestrictionBean.setAudienceURIs(audiences);
conditions.setAudienceRestrictions(Collections.singletonList(audienceRestrictionBean));