You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2013/11/07 13:17:07 UTC
svn commit: r1539608 [1/2] - in /cxf/trunk:
rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/
services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/caching/
services/sts/systests/basic/ services/sts/systests/basic/sr...
Author: coheigea
Date: Thu Nov 7 12:17:06 2013
New Revision: 1539608
URL: http://svn.apache.org/r1539608
Log:
Added some tests + some fixes for configuring the STSClient via the WSDL of the WSP
Added:
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/IssuerTest.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/STSServer.java
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/Server.java
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/DoubleIt.wsdl
- copied, changed from r1539607, cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/caching/DoubleIt.wsdl
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-client.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-service.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-sts-transport.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/sts-transport-policy.xml
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/ws-trust-1.4-service.wsdl
Modified:
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/caching/DoubleIt.wsdl
cxf/trunk/services/sts/systests/basic/pom.xml
cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java?rev=1539608&r1=1539607&r2=1539608&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java Thu Nov 7 12:17:06 2013
@@ -45,7 +45,6 @@ import javax.xml.transform.dom.DOMSource
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-
import org.apache.cxf.Bus;
import org.apache.cxf.BusException;
import org.apache.cxf.binding.soap.SoapBindingConstants;
@@ -92,6 +91,8 @@ import org.apache.cxf.ws.policy.Effectiv
import org.apache.cxf.ws.policy.PolicyBuilder;
import org.apache.cxf.ws.policy.PolicyConstants;
import org.apache.cxf.ws.policy.PolicyEngine;
+import org.apache.cxf.ws.policy.attachment.reference.ReferenceResolver;
+import org.apache.cxf.ws.policy.attachment.reference.RemoteReferenceResolver;
import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion;
import org.apache.cxf.ws.security.SecurityConstants;
import org.apache.cxf.ws.security.tokenstore.SecurityToken;
@@ -103,6 +104,7 @@ import org.apache.neethi.All;
import org.apache.neethi.ExactlyOne;
import org.apache.neethi.Policy;
import org.apache.neethi.PolicyComponent;
+import org.apache.neethi.PolicyRegistry;
import org.apache.wss4j.common.crypto.Crypto;
import org.apache.wss4j.common.crypto.CryptoFactory;
import org.apache.wss4j.common.crypto.CryptoType;
@@ -207,6 +209,10 @@ public abstract class AbstractSTSClient
public void setBeanName(String s) {
name = s;
}
+
+ public String getLocation() {
+ return location;
+ }
public void setLocation(String location) {
this.location = location;
@@ -243,6 +249,8 @@ public abstract class AbstractSTSClient
this.setPolicyInternal((Policy) newPolicy);
} else if (newPolicy instanceof Element) {
this.setPolicyInternal((Element) newPolicy);
+ } else if (newPolicy instanceof String) {
+ this.setPolicyInternal((String) newPolicy);
} else {
throw new IllegalArgumentException("Unsupported policy object. Type must be "
+ "org.apache.neethi.Policy or org.w3c.dom.Element.");
@@ -455,6 +463,18 @@ public abstract class AbstractSTSClient
protected void setPolicyInternal(Element newPolicy) {
this.setPolicyInternal(bus.getExtension(PolicyBuilder.class).getPolicy(newPolicy));
}
+
+ protected void setPolicyInternal(String policyReference) {
+ PolicyBuilder builder = bus.getExtension(PolicyBuilder.class);
+ ReferenceResolver resolver = new RemoteReferenceResolver(null, builder);
+ PolicyRegistry registry = bus.getExtension(PolicyEngine.class).getRegistry();
+ Policy resolved = registry.lookup(policyReference);
+ if (null != resolved) {
+ this.setPolicyInternal(resolved);
+ } else {
+ this.setPolicyInternal(resolver.resolveReference(policyReference));
+ }
+ }
public Client getClient() throws BusException, EndpointException {
if (client == null) {
@@ -468,6 +488,9 @@ public abstract class AbstractSTSClient
return;
}
location = EndpointReferenceUtils.getAddress(ref);
+ if (location != null) {
+ location = location.trim();
+ }
final QName sName = EndpointReferenceUtils.getServiceName(ref, bus);
if (sName != null) {
serviceName = sName;
Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java?rev=1539608&r1=1539607&r2=1539608&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java (original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSUtils.java Thu Nov 7 12:17:06 2013
@@ -105,19 +105,21 @@ public final class STSUtils {
if (MessageUtils.getContextualBoolean(message, SecurityConstants.STS_CLIENT_SOAP12_BINDING, false)) {
client.setSoap12();
}
- if ((itok != null) && (itok.getIssuer() != null)) {
- EndpointReferenceType epr = null;
- try {
- epr = VersionTransformer.parseEndpointReference(itok.getIssuer());
- } catch (JAXBException e) {
- throw new IllegalArgumentException(e);
- }
- //configure via mex
- boolean useEPRWSAAddrAsMEXLocation = !Boolean.valueOf(
- (String)message.getContextualProperty(
- SecurityConstants.DISABLE_STS_CLIENT_WSMEX_CALL_USING_EPR_ADDRESS));
- client.configureViaEPR(epr, useEPRWSAAddrAsMEXLocation);
+ }
+
+ if (client.getLocation() == null && client.getWsdlLocation() == null
+ && itok != null && itok.getIssuer() != null) {
+ EndpointReferenceType epr = null;
+ try {
+ epr = VersionTransformer.parseEndpointReference(itok.getIssuer());
+ } catch (JAXBException e) {
+ throw new IllegalArgumentException(e);
}
+ //configure via mex
+ boolean useEPRWSAAddrAsMEXLocation =
+ !Boolean.valueOf((String)message.getContextualProperty(
+ SecurityConstants.DISABLE_STS_CLIENT_WSMEX_CALL_USING_EPR_ADDRESS));
+ client.configureViaEPR(epr, useEPRWSAAddrAsMEXLocation);
}
return client;
}
Modified: cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/caching/DoubleIt.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/caching/DoubleIt.wsdl?rev=1539608&r1=1539607&r2=1539608&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/caching/DoubleIt.wsdl (original)
+++ cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/caching/DoubleIt.wsdl Thu Nov 7 12:17:06 2013
@@ -193,20 +193,6 @@
<wsp:Policy>
<sp:RequireInternalReference />
</wsp:Policy>
- <sp:Issuer>
- <wsaw:Address>http://localhost:8080/SecurityTokenService/UT
- </wsaw:Address>
- <wsaw:Metadata>
- <wsx:Metadata>
- <wsx:MetadataSection>
- <wsx:MetadataReference>
- <wsaw:Address>http://localhost:8080/SecurityTokenService/UT/mex
- </wsaw:Address>
- </wsx:MetadataReference>
- </wsx:MetadataSection>
- </wsx:Metadata>
- </wsaw:Metadata>
- </sp:Issuer>
</sp:IssuedToken>
</wsp:Policy>
</sp:TransportToken>
Modified: cxf/trunk/services/sts/systests/basic/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/pom.xml?rev=1539608&r1=1539607&r2=1539608&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/pom.xml (original)
+++ cxf/trunk/services/sts/systests/basic/pom.xml Thu Nov 7 12:17:06 2013
@@ -69,6 +69,12 @@
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-ws-mex</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
<artifactId>cxf-testutils</artifactId>
<version>${project.version}</version>
<scope>test</scope>
Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java?rev=1539608&r1=1539607&r2=1539608&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/common/TokenTestUtils.java Thu Nov 7 12:17:06 2013
@@ -77,9 +77,9 @@ public final class TokenTestUtils {
STSClient stsClient = (STSClient)p.getRequestContext().get(SecurityConstants.STS_CLIENT);
if (stsClient != null) {
String location = stsClient.getWsdlLocation();
- if (location.contains("8080")) {
+ if (location != null && location.contains("8080")) {
stsClient.setWsdlLocation(location.replace("8080", port));
- } else if (location.contains("8443")) {
+ } else if (location != null && location.contains("8443")) {
stsClient.setWsdlLocation(location.replace("8443", port));
}
}
Added: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/IssuerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/IssuerTest.java?rev=1539608&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/IssuerTest.java (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/IssuerTest.java Thu Nov 7 12:17:06 2013
@@ -0,0 +1,143 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.sts.issuer;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.sts.common.SecurityTestUtil;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.example.contract.doubleit.DoubleItPortType;
+import org.junit.BeforeClass;
+
+/**
+ * Some tests where the STS address is not hard-coded in the client
+ */
+public class IssuerTest extends AbstractBusClientServerTestBase {
+
+ private static final String NAMESPACE = "http://www.example.org/contract/DoubleIt";
+ private static final QName SERVICE_QNAME = new QName(NAMESPACE, "DoubleItService");
+
+ private static final String PORT = allocatePort(Server.class);
+
+ private static boolean standalone;
+
+ @BeforeClass
+ public static void startServers() throws Exception {
+ assertTrue(
+ "Server failed to launch",
+ // run the server in the same process
+ // set this to false to fork
+ launchServer(Server.class, true)
+ );
+
+ try {
+ ServerSocket sock = new ServerSocket(30101);
+ sock.close();
+
+ String deployment = System.getProperty("sts.deployment");
+ if ("standalone".equals(deployment) || deployment == null) {
+ standalone = true;
+ assertTrue(
+ "Server failed to launch",
+ // run the server in the same process
+ // set this to false to fork
+ launchServer(STSServer.class, true)
+ );
+ }
+ } catch (IOException ex) {
+ // standalone is set to false + the test won't run
+ }
+ }
+
+ @org.junit.AfterClass
+ public static void cleanup() throws Exception {
+ SecurityTestUtil.cleanup();
+ stopAllServers();
+ }
+
+ // In this test, the client uses the address defined in the <sp:Issuer> address in the policy
+ // of the service provider to contact the STS. The client is configured with the STS's service
+ // Policy. Useful if you want a simple way to avoid hardcoding the STS host/port in the client.
+ @org.junit.Test
+ public void testSAML1Issuer() throws Exception {
+
+ if (!standalone) {
+ return;
+ }
+
+ SpringBusFactory bf = new SpringBusFactory();
+ URL busFile = IssuerTest.class.getResource("cxf-client.xml");
+
+ Bus bus = bf.createBus(busFile.toString());
+ SpringBusFactory.setDefaultBus(bus);
+ SpringBusFactory.setThreadDefaultBus(bus);
+
+ URL wsdl = IssuerTest.class.getResource("DoubleIt.wsdl");
+ Service service = Service.create(wsdl, SERVICE_QNAME);
+ QName portQName = new QName(NAMESPACE, "DoubleItTransportSAML1Port");
+ DoubleItPortType transportSaml1Port =
+ service.getPort(portQName, DoubleItPortType.class);
+ updateAddressPort(transportSaml1Port, PORT);
+
+ doubleIt(transportSaml1Port, 25);
+
+ ((java.io.Closeable)transportSaml1Port).close();
+ bus.shutdown(true);
+ }
+
+ // Test getting the STS details via WS-MEX
+ @org.junit.Test
+ public void testSAML2MEX() throws Exception {
+
+ if (!standalone) {
+ return;
+ }
+
+ SpringBusFactory bf = new SpringBusFactory();
+ URL busFile = IssuerTest.class.getResource("cxf-client.xml");
+
+ Bus bus = bf.createBus(busFile.toString());
+ SpringBusFactory.setDefaultBus(bus);
+ SpringBusFactory.setThreadDefaultBus(bus);
+
+ URL wsdl = IssuerTest.class.getResource("DoubleIt.wsdl");
+ Service service = Service.create(wsdl, SERVICE_QNAME);
+ QName portQName = new QName(NAMESPACE, "DoubleItTransportSAML2Port");
+ DoubleItPortType transportSaml2Port =
+ service.getPort(portQName, DoubleItPortType.class);
+ updateAddressPort(transportSaml2Port, PORT);
+
+ doubleIt(transportSaml2Port, 25);
+
+ ((java.io.Closeable)transportSaml2Port).close();
+ bus.shutdown(true);
+ }
+
+ private static void doubleIt(DoubleItPortType port, int numToDouble) {
+ int resp = port.doubleIt(numToDouble);
+ assertEquals(numToDouble * 2 , resp);
+ }
+}
Added: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/STSServer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/STSServer.java?rev=1539608&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/STSServer.java (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/STSServer.java Thu Nov 7 12:17:06 2013
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.sts.issuer;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class STSServer extends AbstractBusTestServerBase {
+
+ public STSServer() {
+
+ }
+
+ protected void run() {
+ URL busFile = STSServer.class.getResource("cxf-sts-transport.xml");
+ Bus busLocal = new SpringBusFactory().createBus(busFile);
+ BusFactory.setDefaultBus(busLocal);
+ setBus(busLocal);
+
+ try {
+ new STSServer();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
Added: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/Server.java?rev=1539608&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/Server.java (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/issuer/Server.java Thu Nov 7 12:17:06 2013
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.sts.issuer;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class Server extends AbstractBusTestServerBase {
+
+ public Server() {
+
+ }
+
+ protected void run() {
+ URL busFile = Server.class.getResource("cxf-service.xml");
+ Bus busLocal = new SpringBusFactory().createBus(busFile);
+ BusFactory.setDefaultBus(busLocal);
+ setBus(busLocal);
+
+ try {
+ new Server();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
Copied: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/DoubleIt.wsdl (from r1539607, cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/caching/DoubleIt.wsdl)
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/DoubleIt.wsdl?p2=cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/DoubleIt.wsdl&p1=cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/caching/DoubleIt.wsdl&r1=1539607&r2=1539608&rev=1539608&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/advanced/src/test/resources/org/apache/cxf/systest/sts/caching/DoubleIt.wsdl (original)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/DoubleIt.wsdl Thu Nov 7 12:17:06 2013
@@ -28,22 +28,6 @@
<wsdl:import location="src/test/resources/DoubleItLogical.wsdl"
namespace="http://www.example.org/contract/DoubleIt"/>
- <wsdl:binding name="DoubleItTransportUTBinding" type="tns:DoubleItPortType">
- <wsp:PolicyReference URI="#DoubleItBindingTransportUTPolicy" />
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="DoubleIt">
- <soap:operation soapAction="" />
- <wsdl:input>
- <soap:body use="literal" />
- <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Input_Policy" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Output_Policy" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
<wsdl:binding name="DoubleItTransportSAML1Binding" type="tns:DoubleItPortType">
<wsp:PolicyReference URI="#DoubleItBindingTransportSAML1Policy" />
<soap:binding style="document"
@@ -60,24 +44,8 @@
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:binding name="DoubleItTransportSAML1Binding2" type="tns:DoubleItPortType">
- <wsp:PolicyReference URI="#DoubleItBindingTransportSAML1Policy" />
- <soap:binding style="document"
- transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="DoubleIt">
- <soap:operation soapAction="" />
- <wsdl:input>
- <soap:body use="literal" />
- <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Input_Policy" />
- </wsdl:input>
- <wsdl:output>
- <soap:body use="literal" />
- <wsp:PolicyReference URI="#DoubleItBinding_DoubleIt_Output_Policy" />
- </wsdl:output>
- </wsdl:operation>
- </wsdl:binding>
- <wsdl:binding name="DoubleItAsymmetricBSTBinding" type="tns:DoubleItPortType">
- <wsp:PolicyReference URI="#DoubleItBindingAsymmetricBSTPolicy" />
+ <wsdl:binding name="DoubleItTransportSAML2Binding" type="tns:DoubleItPortType">
+ <wsp:PolicyReference URI="#DoubleItBindingTransportSAML2Policy" />
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="DoubleIt">
@@ -94,29 +62,17 @@
</wsdl:binding>
<wsdl:service name="DoubleItService">
- <wsdl:port name="DoubleItTransportUTPort" binding="tns:DoubleItTransportUTBinding">
- <soap:address
- location="https://localhost:8081/doubleit/services/doubleittransportut" />
- </wsdl:port>
<wsdl:port name="DoubleItTransportSAML1Port" binding="tns:DoubleItTransportSAML1Binding">
<soap:address
location="https://localhost:8081/doubleit/services/doubleittransportsaml1" />
</wsdl:port>
- <wsdl:port name="DoubleItTransportSAML1Port2" binding="tns:DoubleItTransportSAML1Binding2">
- <soap:address
- location="https://localhost:8081/doubleit/services/doubleittransportsaml12" />
- </wsdl:port>
- <wsdl:port name="DoubleItTransportSAML1AlternativePort" binding="tns:DoubleItTransportSAML1Binding">
- <soap:address
- location="https://localhost:8081/doubleit/services/doubleittransportsaml1alternative" />
- </wsdl:port>
- <wsdl:port name="DoubleItAsymmetricBSTPort" binding="tns:DoubleItAsymmetricBSTBinding">
+ <wsdl:port name="DoubleItTransportSAML2Port" binding="tns:DoubleItTransportSAML2Binding">
<soap:address
- location="http://localhost:8082/doubleit/services/doubleitasymmetricbst" />
+ location="https://localhost:8081/doubleit/services/doubleittransportsaml2" />
</wsdl:port>
</wsdl:service>
- <wsp:Policy wsu:Id="DoubleItBindingTransportUTPolicy">
+ <wsp:Policy wsu:Id="DoubleItBindingTransportSAML1Policy">
<wsp:ExactlyOne>
<wsp:All>
<wsam:Addressing wsp:Optional="false">
@@ -127,8 +83,8 @@
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
- <sp:HttpsToken>
- <wsp:Policy/>
+ <sp:HttpsToken>
+ <wsp:Policy/>
</sp:HttpsToken>
</wsp:Policy>
</sp:TransportToken>
@@ -145,17 +101,27 @@
<sp:IncludeTimestamp />
</wsp:Policy>
</sp:TransportBinding>
- <sp:SignedSupportingTokens
- xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
- <wsp:Policy>
- <sp:UsernameToken
- sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
- <wsp:Policy>
- <sp:WssUsernameToken11 />
- </wsp:Policy>
- </sp:UsernameToken>
- </wsp:Policy>
- </sp:SignedSupportingTokens>
+ <sp:EndorsingSupportingTokens
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:IssuedToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
+ <sp:RequestSecurityTokenTemplate>
+ <t:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</t:TokenType>
+ <t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey</t:KeyType>
+ </sp:RequestSecurityTokenTemplate>
+ <wsp:Policy>
+ <sp:RequireInternalReference />
+ </wsp:Policy>
+ <sp:Issuer>
+ <wsaw:Address>https://localhost:30101/SecurityTokenService/Transport</wsaw:Address>
+ <wsaw:Metadata xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512/">
+ <wsam:ServiceName EndpointName="Transport_Port">wst:SecurityTokenService</wsam:ServiceName>
+ </wsaw:Metadata>
+ </sp:Issuer>
+ </sp:IssuedToken>
+ </wsp:Policy>
+ </sp:EndorsingSupportingTokens>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefIssuerSerial />
@@ -173,7 +139,7 @@
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
- <wsp:Policy wsu:Id="DoubleItBindingTransportSAML1Policy">
+ <wsp:Policy wsu:Id="DoubleItBindingTransportSAML2Policy">
<wsp:ExactlyOne>
<wsp:All>
<wsam:Addressing wsp:Optional="false">
@@ -184,30 +150,9 @@
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
- <sp:IssuedToken
- sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
- <sp:RequestSecurityTokenTemplate>
- <t:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</t:TokenType>
- <t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey</t:KeyType>
- </sp:RequestSecurityTokenTemplate>
- <wsp:Policy>
- <sp:RequireInternalReference />
- </wsp:Policy>
- <sp:Issuer>
- <wsaw:Address>http://localhost:8080/SecurityTokenService/UT
- </wsaw:Address>
- <wsaw:Metadata>
- <wsx:Metadata>
- <wsx:MetadataSection>
- <wsx:MetadataReference>
- <wsaw:Address>http://localhost:8080/SecurityTokenService/UT/mex
- </wsaw:Address>
- </wsx:MetadataReference>
- </wsx:MetadataSection>
- </wsx:Metadata>
- </wsaw:Metadata>
- </sp:Issuer>
- </sp:IssuedToken>
+ <sp:HttpsToken>
+ <wsp:Policy/>
+ </sp:HttpsToken>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
@@ -223,66 +168,33 @@
<sp:IncludeTimestamp />
</wsp:Policy>
</sp:TransportBinding>
- <sp:Wss11>
- <wsp:Policy>
- <sp:MustSupportRefIssuerSerial />
- <sp:MustSupportRefThumbprint />
- <sp:MustSupportRefEncryptedKey />
- </wsp:Policy>
- </sp:Wss11>
- <sp:Trust13>
- <wsp:Policy>
- <sp:MustSupportIssuedTokens />
- <sp:RequireClientEntropy />
- <sp:RequireServerEntropy />
- </wsp:Policy>
- </sp:Trust13>
- </wsp:All>
- </wsp:ExactlyOne>
- </wsp:Policy>
- <wsp:Policy wsu:Id="DoubleItBindingAsymmetricBSTPolicy">
- <wsp:ExactlyOne>
- <wsp:All>
- <wsam:Addressing wsp:Optional="false">
- <wsp:Policy />
- </wsam:Addressing>
- <sp:AsymmetricBinding>
- <wsp:Policy>
- <sp:InitiatorToken>
- <wsp:Policy>
- <sp:X509Token
- sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
- <wsp:Policy>
- <sp:WssX509V3Token10 />
- </wsp:Policy>
- </sp:X509Token>
- </wsp:Policy>
- </sp:InitiatorToken>
- <sp:RecipientToken>
- <wsp:Policy>
- <sp:X509Token
- sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
- <wsp:Policy>
- <sp:WssX509V3Token10 />
- <sp:RequireIssuerSerialReference />
- </wsp:Policy>
- </sp:X509Token>
- </wsp:Policy>
- </sp:RecipientToken>
- <sp:Layout>
- <wsp:Policy>
- <sp:Lax />
- </wsp:Policy>
- </sp:Layout>
- <sp:IncludeTimestamp />
- <sp:OnlySignEntireHeadersAndBody />
- <sp:AlgorithmSuite>
- <wsp:Policy>
- <sp:Basic128 />
- </wsp:Policy>
- </sp:AlgorithmSuite>
- </wsp:Policy>
- </sp:AsymmetricBinding>
+ <sp:EndorsingSupportingTokens
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:IssuedToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
+ <sp:RequestSecurityTokenTemplate>
+ <t:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1</t:TokenType>
+ <t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey</t:KeyType>
+ </sp:RequestSecurityTokenTemplate>
+ <wsp:Policy>
+ <sp:RequireInternalReference />
+ </wsp:Policy>
+ <sp:Issuer>
+ <wsaw:Address>https://localhost:30101/SecurityTokenService/Transport</wsaw:Address>
+ <wsaw:Metadata>
+ <wsx:Metadata>
+ <wsx:MetadataSection>
+ <wsx:MetadataReference>
+ <wsaw:Address>https://localhost:30101/SecurityTokenService/Transport/mex</wsaw:Address>
+ </wsx:MetadataReference>
+ </wsx:MetadataSection>
+ </wsx:Metadata>
+ </wsaw:Metadata>
+ </sp:Issuer>
+ </sp:IssuedToken>
+ </wsp:Policy>
+ </sp:EndorsingSupportingTokens>
<sp:Wss11>
<wsp:Policy>
<sp:MustSupportRefIssuerSerial />
Added: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-client.xml?rev=1539608&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-client.xml (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-client.xml Thu Nov 7 12:17:06 2013
@@ -0,0 +1,84 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:jaxws="http://cxf.apache.org/jaxws"
+ xmlns:cxf="http://cxf.apache.org/core"
+ xmlns:http="http://cxf.apache.org/transports/http/configuration"
+ xmlns:sec="http://cxf.apache.org/configuration/security"
+ xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
+http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd">
+
+ <cxf:bus>
+ <cxf:features>
+ <cxf:logging/>
+ </cxf:features>
+ </cxf:bus>
+
+ <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItTransportSAML1Port" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username" value="alice"/>
+ <entry key="ws-security.callback-handler"
+ value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
+ <entry key="ws-security.sts.disable-wsmex-call-using-epr-address" value="true"/>
+ <entry key="ws-security.sts.client">
+ <bean class="org.apache.cxf.ws.security.trust.STSClient">
+ <constructor-arg ref="cxf"/>
+ <property name="policy"
+ value="classpath:/org/apache/cxf/systest/sts/issuer/sts-transport-policy.xml"/>
+ <property name="properties">
+ <map>
+ <entry key="ws-security.sts.token.username" value="myclientkey"/>
+ <entry key="ws-security.sts.token.properties" value="clientKeystore.properties"/>
+ <entry key="ws-security.sts.token.usecert" value="true"/>
+ </map>
+ </property>
+ </bean>
+ </entry>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItTransportSAML2Port" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username" value="alice"/>
+ <entry key="ws-security.callback-handler"
+ value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
+ <entry key="ws-security.sts.token.username" value="myclientkey"/>
+ <entry key="ws-security.sts.token.properties" value="clientKeystore.properties"/>
+ <entry key="ws-security.sts.token.usecert" value="true"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <http:conduit name="https://localhost.*">
+ <http:tlsClientParameters disableCNCheck="true">
+ <sec:keyManagers keyPassword="ckpass">
+ <sec:keyStore type="jks" password="cspass" resource="clientstore.jks"/>
+ </sec:keyManagers>
+ <sec:trustManagers>
+ <sec:keyStore type="jks" password="cspass" resource="clientstore.jks"/>
+ </sec:trustManagers>
+ </http:tlsClientParameters>
+ </http:conduit>
+
+</beans>
+
Added: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-service.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-service.xml?rev=1539608&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-service.xml (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-service.xml Thu Nov 7 12:17:06 2013
@@ -0,0 +1,104 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:cxf="http://cxf.apache.org/core"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:sec="http://cxf.apache.org/configuration/security"
+ xmlns:http="http://cxf.apache.org/transports/http/configuration"
+ xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+ xmlns:jaxws="http://cxf.apache.org/jaxws"
+ xsi:schemaLocation="
+ http://cxf.apache.org/core
+ http://cxf.apache.org/schemas/core.xsd
+ http://cxf.apache.org/configuration/security
+ http://cxf.apache.org/schemas/configuration/security.xsd
+ http://cxf.apache.org/jaxws
+ http://cxf.apache.org/schemas/jaxws.xsd
+ http://cxf.apache.org/transports/http/configuration
+ http://cxf.apache.org/schemas/configuration/http-conf.xsd
+ http://cxf.apache.org/transports/http-jetty/configuration
+ http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
+ <jaxws:endpoint id="doubleittransportsaml1"
+ implementor="org.apache.cxf.systest.sts.common.DoubleItPortTypeImpl"
+ endpointName="s:DoubleItTransportSAML1Port"
+ serviceName="s:DoubleItService"
+ depends-on="ClientAuthHttpsSettings"
+ address="https://localhost:${testutil.ports.Server}/doubleit/services/doubleittransportsaml1"
+ wsdlLocation="org/apache/cxf/systest/sts/issuer/DoubleIt.wsdl"
+ xmlns:s="http://www.example.org/contract/DoubleIt">
+
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler"
+ value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
+ <entry key="ws-security.signature.properties" value="serviceKeystore.properties"/>
+ <entry key="ws-security.saml1.validator">
+ <bean class="org.apache.cxf.ws.security.trust.STSTokenValidator"/>
+ </entry>
+ <entry key="ws-security.is-bsp-compliant" value="false"/>
+ </jaxws:properties>
+ </jaxws:endpoint>
+
+ <jaxws:endpoint id="doubleittransportsaml2"
+ implementor="org.apache.cxf.systest.sts.common.DoubleItPortTypeImpl"
+ endpointName="s:DoubleItTransportSAML2Port"
+ serviceName="s:DoubleItService"
+ depends-on="ClientAuthHttpsSettings"
+ address="https://localhost:${testutil.ports.Server}/doubleit/services/doubleittransportsaml2"
+ wsdlLocation="org/apache/cxf/systest/sts/issuer/DoubleIt.wsdl"
+ xmlns:s="http://www.example.org/contract/DoubleIt">
+
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler"
+ value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
+ <entry key="ws-security.signature.properties" value="serviceKeystore.properties"/>
+ <entry key="ws-security.saml2.validator">
+ <bean class="org.apache.cxf.ws.security.trust.STSTokenValidator"/>
+ </entry>
+ </jaxws:properties>
+ </jaxws:endpoint>
+
+ <httpj:engine-factory id="ClientAuthHttpsSettings" bus="cxf">
+ <httpj:engine port="${testutil.ports.Server}">
+ <httpj:tlsServerParameters>
+ <sec:keyManagers keyPassword="skpass">
+ <sec:keyStore type="jks" password="sspass" resource="servicestore.jks"/>
+ </sec:keyManagers>
+ <sec:trustManagers>
+ <sec:keyStore type="jks" password="stsspass" resource="stsstore.jks"/>
+ </sec:trustManagers>
+ <sec:cipherSuitesFilter>
+ <sec:include>.*_EXPORT_.*</sec:include>
+ <sec:include>.*_EXPORT1024_.*</sec:include>
+ <sec:include>.*_WITH_DES_.*</sec:include>
+ <sec:include>.*_WITH_AES_.*</sec:include>
+ <sec:include>.*_WITH_NULL_.*</sec:include>
+ <sec:exclude>.*_DH_anon_.*</sec:exclude>
+ </sec:cipherSuitesFilter>
+ <sec:clientAuthentication want="true" required="true"/>
+ </httpj:tlsServerParameters>
+ </httpj:engine>
+ </httpj:engine-factory>
+
+</beans>
+
Added: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-sts-transport.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-sts-transport.xml?rev=1539608&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-sts-transport.xml (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/cxf-sts-transport.xml Thu Nov 7 12:17:06 2013
@@ -0,0 +1,227 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans
+ xmlns="http://www.springframework.org/schema/beans"
+ xmlns:cxf="http://cxf.apache.org/core"
+ xmlns:jaxws="http://cxf.apache.org/jaxws"
+ xmlns:sec="http://cxf.apache.org/configuration/security"
+ xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+ xmlns:test="http://apache.org/hello_world_soap_http"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:util="http://www.springframework.org/schema/util"
+ xsi:schemaLocation="
+ http://cxf.apache.org/core
+ http://cxf.apache.org/schemas/core.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://cxf.apache.org/jaxws
+ http://cxf.apache.org/schemas/jaxws.xsd
+ http://cxf.apache.org/configuration/security
+ http://cxf.apache.org/schemas/configuration/security.xsd
+ http://cxf.apache.org/transports/http-jetty/configuration
+ http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+ http://www.springframework.org/schema/util
+ http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
+ <cxf:bus>
+ <cxf:features>
+ <cxf:logging/>
+ </cxf:features>
+ </cxf:bus>
+
+ <bean id="hokDelegationHandler"
+ class="org.apache.cxf.sts.token.delegation.HOKDelegationHandler" />
+
+ <bean id="transportSTSProviderBean2"
+ class="org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider">
+ <property name="issueOperation" ref="transportIssueDelegate2" />
+ <property name="validateOperation" ref="transportValidateDelegate2" />
+ </bean>
+
+ <bean id="transportIssueDelegate2" class="org.apache.cxf.sts.operation.TokenIssueOperation">
+ <property name="tokenProviders" ref="transportTokenProviders2" />
+ <property name="tokenValidators" ref="transportTokenValidators" />
+ <property name="services" ref="transportService" />
+ <property name="stsProperties" ref="transportSTSProperties" />
+ <property name="delegationHandlers" ref="hokDelegationHandler" />
+ </bean>
+
+ <bean id="transportValidateDelegate2" class="org.apache.cxf.sts.operation.TokenValidateOperation">
+ <property name="tokenValidators" ref="transportTokenValidators2" />
+ <property name="stsProperties" ref="transportSTSProperties" />
+ </bean>
+
+ <util:list id="transportTokenValidators2">
+ <ref bean="transportSamlTokenValidator2" />
+ </util:list>
+
+ <util:list id="transportTokenProviders2">
+ <ref bean="transportSamlTokenProvider2" />
+ </util:list>
+
+ <bean id="transportSamlTokenValidator2" class="org.apache.cxf.sts.token.validator.SAMLTokenValidator">
+ <property name="samlRealmCodec" ref="samlRealmCodec" />
+ </bean>
+
+ <bean id="transportSamlTokenProvider2" class="org.apache.cxf.sts.token.provider.SAMLTokenProvider">
+ <property name="realmMap" ref="realms"/>
+ </bean>
+
+ <bean id="transportIssueDelegate" class="org.apache.cxf.sts.operation.TokenIssueOperation">
+ <property name="tokenProviders" ref="transportTokenProviders" />
+ <property name="tokenValidators" ref="transportTokenValidators" />
+ <property name="services" ref="transportService" />
+ <property name="stsProperties" ref="transportSTSProperties" />
+ <property name="delegationHandlers" ref="hokDelegationHandler" />
+ </bean>
+
+ <bean id="transportValidateDelegate" class="org.apache.cxf.sts.operation.TokenValidateOperation">
+ <property name="tokenValidators" ref="transportTokenValidators" />
+ <property name="stsProperties" ref="transportSTSProperties" />
+ </bean>
+
+ <util:list id="transportTokenValidators">
+ <ref bean="transportSamlTokenValidator" />
+ </util:list>
+
+ <util:list id="transportTokenProviders">
+ <ref bean="transportSamlTokenProvider" />
+ </util:list>
+
+ <bean id="transportSamlTokenValidator" class="org.apache.cxf.sts.token.validator.SAMLTokenValidator">
+ </bean>
+
+ <bean id="transportSamlTokenProvider" class="org.apache.cxf.sts.token.provider.SAMLTokenProvider">
+ </bean>
+
+ <bean id="transportSTSProviderBean"
+ class="org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider">
+ <property name="issueOperation" ref="transportIssueDelegate" />
+ <property name="validateOperation" ref="transportValidateDelegate" />
+ </bean>
+
+ <bean id="transportService" class="org.apache.cxf.sts.service.StaticService">
+ <property name="endpoints" ref="transportEndpoints" />
+ </bean>
+
+ <util:list id="transportEndpoints">
+ <value>https://localhost:(\d)*/doubleit/services/doubleittransport.*
+ </value>
+ </util:list>
+
+ <bean id="realmA"
+ class="org.apache.cxf.sts.token.realm.SAMLRealm">
+ <property name="issuer" value="a-issuer"/>
+ </bean>
+
+ <bean id="realmB"
+ class="org.apache.cxf.sts.token.realm.SAMLRealm">
+ <property name="issuer" value="b-issuer"/>
+ </bean>
+
+ <util:map id="realms">
+ <entry key="a-issuer" value-ref="realmA"/>
+ <entry key="b-issuer" value-ref="realmB"/>
+ </util:map>
+
+
+ <bean id="samlRealmCodec" class="org.apache.cxf.systest.sts.common.SAMLRealmCNCodec" />
+
+ <bean id="customRealmParser" class="org.apache.cxf.systest.sts.common.UriRealmParser" />
+
+ <bean id="identityMapper" class="org.apache.cxf.systest.sts.common.CustomIdentityMapper" />
+
+ <util:list id="relationships">
+ <bean class="org.apache.cxf.sts.token.realm.Relationship">
+ <property name="sourceRealm" value="a-issuer" />
+ <property name="targetRealm" value="b-issuer"/>
+ <property name="identityMapper" ref="identityMapper" />
+ <property name="type" value="FederatedIdentity" />
+ </bean>
+ </util:list>
+
+ <bean id="transportSTSProperties" class="org.apache.cxf.sts.StaticSTSProperties">
+ <property name="signaturePropertiesFile" value="stsKeystore.properties" />
+ <property name="signatureUsername" value="mystskey" />
+ <property name="callbackHandlerClass"
+ value="org.apache.cxf.systest.sts.common.CommonCallbackHandler" />
+ <property name="encryptionPropertiesFile" value="stsKeystore.properties" />
+ <property name="issuer" value="DoubleItSTSIssuer" />
+ <property name="encryptionUsername" value="myservicekey" />
+
+ <property name="realmParser" ref="customRealmParser"/>
+
+ <property name="relationships" ref="relationships" />
+ <property name="samlRealmCodec" ref="samlRealmCodec" />
+ </bean>
+
+ <jaxws:endpoint id="transportSTS" implementor="#transportSTSProviderBean"
+ address="https://localhost:30101/SecurityTokenService/Transport"
+ wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
+ xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_Port"
+ depends-on="ClientAuthHttpsSettings">
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler"
+ value="org.apache.cxf.systest.sts.common.CommonCallbackHandler" />
+ </jaxws:properties>
+ </jaxws:endpoint>
+
+
+ <jaxws:endpoint id="transportSTS-realmB" implementor="#transportSTSProviderBean2"
+ address="https://localhost:30101/SecurityTokenService/b-issuer/Transport"
+ wsdlLocation="src/test/resources/org/apache/cxf/systest/sts/deployment/ws-trust-1.4-service.wsdl"
+ xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512/"
+ serviceName="ns1:SecurityTokenService" endpointName="ns1:Transport_SAML_Port"
+ depends-on="ClientAuthHttpsSettings">
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler"
+ value="org.apache.cxf.systest.sts.common.CommonCallbackHandler" />
+ <entry key="ws-security.signature.properties" value="stsKeystore.properties"/>
+ </jaxws:properties>
+ </jaxws:endpoint>
+
+ <httpj:engine-factory id="ClientAuthHttpsSettings"
+ bus="cxf">
+ <httpj:engine port="30101">
+ <httpj:tlsServerParameters>
+ <sec:keyManagers keyPassword="skpass">
+ <sec:keyStore type="jks" password="sspass" resource="servicestore.jks" />
+ </sec:keyManagers>
+ <sec:trustManagers>
+ <sec:keyStore type="jks" password="stsspass" resource="stsstore.jks" />
+ </sec:trustManagers>
+ <sec:cipherSuitesFilter>
+ <sec:include>.*_EXPORT_.*</sec:include>
+ <sec:include>.*_EXPORT1024_.*</sec:include>
+ <sec:include>.*_WITH_DES_.*</sec:include>
+ <sec:include>.*_WITH_AES_.*</sec:include>
+ <sec:include>.*_WITH_NULL_.*</sec:include>
+ <sec:exclude>.*_DH_anon_.*</sec:exclude>
+ </sec:cipherSuitesFilter>
+ <sec:clientAuthentication want="false"
+ required="false" />
+ </httpj:tlsServerParameters>
+ </httpj:engine>
+ </httpj:engine-factory>
+
+</beans>
+
Added: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/sts-transport-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/sts-transport-policy.xml?rev=1539608&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/sts-transport-policy.xml (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/issuer/sts-transport-policy.xml Thu Nov 7 12:17:06 2013
@@ -0,0 +1,77 @@
+<wsp:Policy wsu:Id="Transport_policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:wsap10="http://www.w3.org/2006/05/addressing/wsdl">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsap10:UsingAddressing />
+ <sp:TransportBinding
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <sp:HttpsToken>
+ <wsp:Policy />
+ </sp:HttpsToken>
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128 />
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax />
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp />
+ </wsp:Policy>
+ </sp:TransportBinding>
+ <sp:SignedSupportingTokens
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsp:Policy>
+ <sp:UsernameToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:WssUsernameToken10 />
+ </wsp:Policy>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </wsp:All>
+ <wsp:All>
+ <wsp:Policy>
+ <sp:SamlToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
+ <wsp:Policy>
+ <sp:WssSamlV20Token11 />
+ </wsp:Policy>
+ </sp:SamlToken>
+ </wsp:Policy>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </sp:SignedSupportingTokens>
+ <sp:Wss11
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier />
+ <sp:MustSupportRefIssuerSerial />
+ <sp:MustSupportRefThumbprint />
+ <sp:MustSupportRefEncryptedKey />
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:Trust13
+ xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+ <wsp:Policy>
+ <sp:MustSupportIssuedTokens />
+ <sp:RequireClientEntropy />
+ <sp:RequireServerEntropy />
+ </wsp:Policy>
+ </sp:Trust13>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
\ No newline at end of file