cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1185276 [3/6] - in /cxf/trunk/services/sts/systests: ./ basic/ basic/src/ basic/src/test/ basic/src/test/java/ basic/src/test/java/org/ basic/src/test/java/org/apache/ basic/src/test/java/org/apache/cxf/ basic/src/test/java/org/apache/cxf/...
Date Mon, 17 Oct 2011 16:15:09 GMT
Added: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_onbehalfof/UsernameOnBehalfOfTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_onbehalfof/UsernameOnBehalfOfTest.java?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_onbehalfof/UsernameOnBehalfOfTest.java (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/username_onbehalfof/UsernameOnBehalfOfTest.java Mon Oct 17 16:15:04 2011
@@ -0,0 +1,428 @@
+/**
+ * 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.username_onbehalfof;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.sts.deployment.STSServer;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.apache.cxf.ws.security.tokenstore.MemoryTokenStore;
+import org.apache.cxf.ws.security.tokenstore.TokenStore;
+import org.apache.cxf.ws.security.trust.STSClient;
+import org.apache.cxf.ws.security.trust.delegation.WSSUsernameCallbackHandler;
+import org.example.contract.doubleit.DoubleItPortType;
+import org.junit.BeforeClass;
+
+/**
+ * In this test case, a CXF client requests a Security Token from an STS, passing a username that
+ * it has obtained from an unknown client as an "OnBehalfOf" element. This username is obtained
+ * by parsing the "ws-security.username" property. The client then invokes on the service 
+ * provider using the returned token from the STS. 
+ */
+public class UsernameOnBehalfOfTest 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);
+    
+    @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)
+        );
+        String deployment = System.getProperty("sts.deployment");
+        if ("standalone".equals(deployment)) {
+            assertTrue(
+                    "Server failed to launch",
+                    // run the server in the same process
+                    // set this to false to fork
+                    launchServer(STSServer.class, true)
+            );
+        }
+    }
+
+    @org.junit.Test
+    public void testUsernameOnBehalfOf() throws Exception {
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = UsernameOnBehalfOfTest.class.getResource("cxf-client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+
+        URL wsdl = UsernameOnBehalfOfTest.class.getResource("DoubleIt.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
+        DoubleItPortType transportPort = 
+            service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(transportPort, PORT);
+
+        // Transport port
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "alice"
+        );
+        doubleIt(transportPort, 25);
+        
+        DoubleItPortType transportPort2 = 
+            service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(transportPort2, PORT);
+        ((BindingProvider)transportPort2).getRequestContext().put(
+            "ws-security.username", "eve"
+        );
+        // This time we expect a failure as the server validator doesn't accept "eve".
+        try {
+            doubleIt(transportPort2, 30);
+            fail("Failure expected on an unknown user");
+        } catch (Exception ex) {
+            // expected
+        }
+    }
+    
+    /**
+     * Test caching the issued token
+     */
+    @org.junit.Test
+    public void testUsernameOnBehalfOfCaching() throws Exception {
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = UsernameOnBehalfOfTest.class.getResource("cxf-client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+
+        URL wsdl = UsernameOnBehalfOfTest.class.getResource("DoubleIt.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
+        
+        //
+        // Proxy no. 1
+        // 
+        DoubleItPortType transportPort = 
+            service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(transportPort, PORT);
+        
+        TokenStore tokenStore = new MemoryTokenStore();
+        ((BindingProvider)transportPort).getRequestContext().put(
+            TokenStore.class.getName(), tokenStore
+        );
+
+        // Make a successful invocation
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "alice"
+        );
+        doubleIt(transportPort, 25);
+        
+        // Change the STSClient so that it can no longer find the STS
+        STSClient stsClient = new STSClient(bus);
+        stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
+        BindingProvider p = (BindingProvider)transportPort;
+        p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
+        
+        // This invocation should be successful as the token is cached
+        doubleIt(transportPort, 25);
+        
+        // 
+        // Proxy no. 2
+        //
+        DoubleItPortType transportPort2 = 
+            service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(transportPort2, PORT);
+        
+        // Change the STSClient so that it can no longer find the STS
+        stsClient = new STSClient(bus);
+        stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
+        p = (BindingProvider)transportPort2;
+        p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
+        
+        // This should fail as the cache is not being used
+        try {
+            doubleIt(transportPort2, 40);
+            fail("Failure expected as the token is not stored in the cache");
+        } catch (Exception ex) {
+            // expected
+        }
+        
+        // Set the cache correctly
+        p.getRequestContext().put(TokenStore.class.getName(), tokenStore);
+        
+        // Make another invocation - this should succeed as the token is cached
+        p.getRequestContext().put("ws-security.username", "alice");
+        doubleIt(transportPort2, 40);
+        
+        // Reset the cache - this invocation should fail
+        p.getRequestContext().put(TokenStore.class.getName(), new MemoryTokenStore());
+        try {
+            doubleIt(transportPort2, 40);
+            fail("Failure expected as the cache is reset");
+        } catch (Exception ex) {
+            // expected
+        }
+    }
+    
+    /**
+     * Test caching the issued token when the STSClient is deployed in an intermediary
+     */
+    @org.junit.Test
+    public void testDifferentUsersCaching() throws Exception {
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = UsernameOnBehalfOfTest.class.getResource("cxf-client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+
+        URL wsdl = UsernameOnBehalfOfTest.class.getResource("DoubleIt.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
+        
+        DoubleItPortType transportPort = 
+            service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(transportPort, PORT);
+        
+        // Disable storing tokens per-proxy
+        ((BindingProvider)transportPort).getRequestContext().put(
+            SecurityConstants.CACHE_ISSUED_TOKEN_IN_ENDPOINT, "false"
+        );
+        
+        // Make a successful invocation
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "alice"
+        );
+        doubleIt(transportPort, 25);
+        
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "bob"
+        );
+        doubleIt(transportPort, 30);
+        
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "eve"
+        );
+        try {
+            doubleIt(transportPort, 30);
+            fail("Failure expected on a bad user");
+        } catch (Exception ex) {
+            //
+        }
+        
+        // Change the STSClient so that it can no longer find the STS
+        STSClient stsClient = new STSClient(bus);
+        stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
+        BindingProvider p = (BindingProvider)transportPort;
+        p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
+        
+        // Make a successful invocation
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "alice"
+        );
+        doubleIt(transportPort, 25);
+        
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "bob"
+        );
+        doubleIt(transportPort, 30);
+        
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "eve2"
+        );
+        try {
+            doubleIt(transportPort, 30);
+            fail("Failure expected on a bad user");
+        } catch (Exception ex) {
+            //
+        }
+        
+        // Reset the cache - this invocation should fail
+        p.getRequestContext().put(TokenStore.class.getName(), new MemoryTokenStore());
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "alice"
+        );
+        try {
+            doubleIt(transportPort, 30);
+            fail("Failure expected");
+        } catch (Exception ex) {
+            //
+        }
+    }
+    
+    /**
+     * Test caching the issued token when the STSClient is deployed in an intermediary
+     */
+    @org.junit.Test
+    public void testAppliesToCaching() throws Exception {
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = UsernameOnBehalfOfTest.class.getResource("cxf-client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+
+        URL wsdl = UsernameOnBehalfOfTest.class.getResource("DoubleIt.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
+        
+        DoubleItPortType transportPort = 
+            service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(transportPort, PORT);
+        
+        // Disable storing tokens per-proxy
+        ((BindingProvider)transportPort).getRequestContext().put(
+            SecurityConstants.CACHE_ISSUED_TOKEN_IN_ENDPOINT, "false"
+        );
+        
+        // Make a successful invocation
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "alice"
+        );
+        BindingProvider p = (BindingProvider)transportPort;
+        p.getRequestContext().put(
+            SecurityConstants.STS_APPLIES_TO, 
+            "http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew"
+        );
+        doubleIt(transportPort, 25);
+        
+        // Make a successful invocation
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "bob"
+        );
+        p.getRequestContext().put(
+            SecurityConstants.STS_APPLIES_TO, 
+            "http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew2"
+        );
+        doubleIt(transportPort, 25);
+        
+        // Change the STSClient so that it can no longer find the STS
+        STSClient stsClient = new STSClient(bus);
+        stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
+        p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
+        
+        // Make a successful invocation - should work as token is cached
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "alice"
+        );
+        p.getRequestContext().put(
+            SecurityConstants.STS_APPLIES_TO, 
+            "http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew"
+        );
+        doubleIt(transportPort, 25);
+        
+        // Make a successful invocation - should work as token is cached
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "bob"
+        );
+        p.getRequestContext().put(
+            SecurityConstants.STS_APPLIES_TO, 
+            "http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew2"
+        );
+        doubleIt(transportPort, 25);
+        
+        // Change appliesTo - should fail
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "alice"
+        );
+        p.getRequestContext().put(
+            SecurityConstants.STS_APPLIES_TO, 
+            "http://localhost:" + PORT + "/doubleit/services/doubleitasymmetricnew2"
+        );
+        try {
+            doubleIt(transportPort, 30);
+            fail("Failure expected");
+        } catch (Exception ex) {
+            //
+        }
+    }
+    
+    /**
+     * Test caching the issued token when the STSClient is deployed in an intermediary
+     */
+    @org.junit.Test
+    public void testNoAppliesToCaching() throws Exception {
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = UsernameOnBehalfOfTest.class.getResource("cxf-client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+
+        URL wsdl = UsernameOnBehalfOfTest.class.getResource("DoubleIt.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricSAML2BearerPort");
+        
+        DoubleItPortType transportPort = 
+            service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(transportPort, PORT);
+        
+        // Disable storing tokens per-proxy
+        ((BindingProvider)transportPort).getRequestContext().put(
+            SecurityConstants.CACHE_ISSUED_TOKEN_IN_ENDPOINT, "false"
+        );
+        
+        // Make a successful invocation
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "alice"
+        );
+        // Disable appliesTo
+        BindingProvider p = (BindingProvider)transportPort;
+        STSClient stsClient = (STSClient)p.getRequestContext().get(SecurityConstants.STS_CLIENT);
+        stsClient.setEnableAppliesTo(false);
+        doubleIt(transportPort, 25);
+        
+        // Change the STSClient so that it can no longer find the STS
+        stsClient = new STSClient(bus);
+        stsClient.setOnBehalfOf(new WSSUsernameCallbackHandler());
+        stsClient.setEnableAppliesTo(false);
+        p.getRequestContext().put(SecurityConstants.STS_CLIENT, stsClient);
+        
+        // This should work
+        doubleIt(transportPort, 25);
+        
+        // Bob should fail
+        ((BindingProvider)transportPort).getRequestContext().put(
+            "ws-security.username", "bob"
+        );
+        try {
+            doubleIt(transportPort, 30);
+            fail("Failure expected");
+        } catch (Exception ex) {
+            //
+        }
+    }
+    
+    private static void doubleIt(DoubleItPortType port, int numToDouble) {
+        int resp = port.doubleIt(numToDouble);
+        System.out.println("The number " + numToDouble + " doubled is " + resp);
+        assertTrue(resp == 2 * numToDouble);
+    }
+}

Added: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/Server.java?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/Server.java (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/Server.java Mon Oct 17 16:15:04 2011
@@ -0,0 +1,50 @@
+/**
+ * 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.x509_symmetric;
+
+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();
+        }
+    }
+    
+    public static void main(String args[]) {
+        new Server().run();
+    }
+}

Added: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/X509SymmetricBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/X509SymmetricBindingTest.java?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/X509SymmetricBindingTest.java (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/x509_symmetric/X509SymmetricBindingTest.java Mon Oct 17 16:15:04 2011
@@ -0,0 +1,113 @@
+/**
+ * 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.x509_symmetric;
+
+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.TokenTestUtils;
+import org.apache.cxf.systest.sts.deployment.STSServer;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+
+import org.example.contract.doubleit.DoubleItPortType;
+import org.junit.BeforeClass;
+
+/**
+ * Test the Symmetric binding. The CXF client gets a token from the STS by authenticating via an
+ * X.509 Cert over the asymmetric binding, and then sends it to the CXF endpoint using 
+ * the symmetric binding.
+ */
+public class X509SymmetricBindingTest 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);
+    
+    @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)
+        );
+        String deployment = System.getProperty("sts.deployment");
+        if ("standalone".equals(deployment)) {
+            assertTrue(
+                    "Server failed to launch",
+                    // run the server in the same process
+                    // set this to false to fork
+                    launchServer(STSServer.class, true)
+            );
+        }
+    }
+
+    @org.junit.Test
+    public void testX509SAML1() throws Exception {
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = X509SymmetricBindingTest.class.getResource("cxf-client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+        
+        URL wsdl = X509SymmetricBindingTest.class.getResource("DoubleIt.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItSymmetricSAML1Port");
+        DoubleItPortType symmetricSaml1Port = 
+            service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(symmetricSaml1Port, PORT);
+
+        doubleIt(symmetricSaml1Port, 25);
+    }
+
+    @org.junit.Test
+    public void testX509SAML2() throws Exception {
+
+        SpringBusFactory bf = new SpringBusFactory();
+        URL busFile = X509SymmetricBindingTest.class.getResource("cxf-client.xml");
+
+        Bus bus = bf.createBus(busFile.toString());
+        SpringBusFactory.setDefaultBus(bus);
+        SpringBusFactory.setThreadDefaultBus(bus);
+
+        URL wsdl = X509SymmetricBindingTest.class.getResource("DoubleIt.wsdl");
+        Service service = Service.create(wsdl, SERVICE_QNAME);
+        QName portQName = new QName(NAMESPACE, "DoubleItSymmetricSAML2Port");
+        DoubleItPortType symmetricSaml2Port = 
+            service.getPort(portQName, DoubleItPortType.class);
+        updateAddressPort(symmetricSaml2Port, PORT);
+        
+        doubleIt(symmetricSaml2Port, 30);
+
+        TokenTestUtils.verifyToken(symmetricSaml2Port);
+    }
+
+    private static void doubleIt(DoubleItPortType port, int numToDouble) {
+        int resp = port.doubleIt(numToDouble);
+        System.out.println("The number " + numToDouble + " doubled is " + resp);
+    }
+}

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/DoubleItLogical.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/DoubleItLogical.wsdl?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/DoubleItLogical.wsdl (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/DoubleItLogical.wsdl Mon Oct 17 16:15:04 2011
@@ -0,0 +1,60 @@
+<!--
+ 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.
+-->
+<wsdl:definitions name="DoubleIt"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:di="http://www.example.org/schema/DoubleIt"
+	xmlns:tns="http://www.example.org/contract/DoubleIt" xmlns:wsp="http://www.w3.org/ns/ws-policy"
+	xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+	xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
+	xmlns:t="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsaw="http://www.w3.org/2005/08/addressing"
+	xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" targetNamespace="http://www.example.org/contract/DoubleIt">
+	<!-- Replaced for wsp: http://schemas.xmlsoap.org/ws/2004/09/policy -->
+	
+	<wsdl:types>
+		<xsd:schema targetNamespace="http://www.example.org/schema/DoubleIt">
+			<xsd:element name="DoubleIt">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="numberToDouble" type="xsd:int" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+			<xsd:element name="DoubleItResponse">
+				<xsd:complexType>
+					<xsd:sequence>
+						<xsd:element name="doubledNumber" type="xsd:int" />
+					</xsd:sequence>
+				</xsd:complexType>
+			</xsd:element>
+		</xsd:schema>
+	</wsdl:types>
+	<wsdl:message name="DoubleItRequest">
+		<wsdl:part element="di:DoubleIt" name="parameters" />
+	</wsdl:message>
+	<wsdl:message name="DoubleItResponse">
+		<wsdl:part element="di:DoubleItResponse" name="parameters" />
+	</wsdl:message>
+	<wsdl:portType name="DoubleItPortType">
+		<wsdl:operation name="DoubleIt">
+			<wsdl:input message="tns:DoubleItRequest" />
+			<wsdl:output message="tns:DoubleItResponse" />
+		</wsdl:operation>
+	</wsdl:portType>
+	
+</wsdl:definitions>

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/clientKeystore.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/clientKeystore.properties?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/clientKeystore.properties (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/clientKeystore.properties Mon Oct 17 16:15:04 2011
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=cspass
+org.apache.ws.security.crypto.merlin.keystore.alias=myclientkey
+org.apache.ws.security.crypto.merlin.keystore.file=clientstore.jks
+

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/clientstore.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/clientstore.jks?rev=1185276&view=auto
==============================================================================
Files cxf/trunk/services/sts/systests/basic/src/test/resources/clientstore.jks (added) and cxf/trunk/services/sts/systests/basic/src/test/resources/clientstore.jks Mon Oct 17 16:15:04 2011 differ

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/eve.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/eve.jks?rev=1185276&view=auto
==============================================================================
Files cxf/trunk/services/sts/systests/basic/src/test/resources/eve.jks (added) and cxf/trunk/services/sts/systests/basic/src/test/resources/eve.jks Mon Oct 17 16:15:04 2011 differ

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/eveKeystore.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/eveKeystore.properties?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/eveKeystore.properties (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/eveKeystore.properties Mon Oct 17 16:15:04 2011
@@ -0,0 +1,23 @@
+#
+# 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.
+#
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=evespass
+org.apache.ws.security.crypto.merlin.keystore.file=eve.jks
+

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/logging.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/logging.properties?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/logging.properties (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/logging.properties Mon Oct 17 16:15:04 2011
@@ -0,0 +1,71 @@
+#
+# 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.
+#
+
+############################################################
+#  	Default Logging Configuration File
+#
+# You can use a different file by specifying a filename
+# with the java.util.logging.config.file system property.  
+# For example java -Djava.util.logging.config.file=myfile
+############################################################
+
+############################################################
+#  	Global properties
+############################################################
+
+# "handlers" specifies a comma separated list of log Handler 
+# classes.  These handlers will be installed during VM startup.
+# Note that these classes must be on the system classpath.
+# By default we only configure a ConsoleHandler, which will only
+# show messages at the WARNING and above levels.
+handlers= java.util.logging.ConsoleHandler
+#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+
+# Default global logging level.
+# This specifies which kinds of events are logged across
+# all loggers.  For any given facility this global level
+# can be overridden by a facility specific level
+# Note that the ConsoleHandler also has a separate level
+# setting to limit messages printed to the console.
+.level= INFO
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+# default file output is in user's home directory.
+java.util.logging.FileHandler.pattern = %h/java%u.log
+java.util.logging.FileHandler.limit = 50000
+java.util.logging.FileHandler.count = 1
+java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
+
+# Limit the message that are printed on the console to WARNING and above.
+java.util.logging.ConsoleHandler.level = FINE
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+
+############################################################
+# Facility specific properties.
+# Provides extra control for each logger.
+############################################################
+
+# For example, set the com.xyz.foo logger to only log SEVERE
+# messages:
+#com.xyz.foo.level = SEVERE

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/DoubleIt.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/DoubleIt.wsdl?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/DoubleIt.wsdl (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/DoubleIt.wsdl Mon Oct 17 16:15:04 2011
@@ -0,0 +1,291 @@
+<!--
+ 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.
+-->
+<wsdl:definitions name="DoubleIt"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:di="http://www.example.org/schema/DoubleIt"
+	xmlns:tns="http://www.example.org/contract/DoubleIt" xmlns:wsp="http://www.w3.org/ns/ws-policy"
+	xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+	xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
+	xmlns:t="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsaw="http://www.w3.org/2005/08/addressing"
+	xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" targetNamespace="http://www.example.org/contract/DoubleIt">
+
+    <wsdl:import location="src/test/resources/DoubleItLogical.wsdl" 
+                 namespace="http://www.example.org/contract/DoubleIt"/>
+
+	<wsdl:binding name="DoubleItAsymmetricSAML1Binding" type="tns:DoubleItPortType">
+		<wsp:PolicyReference URI="#DoubleItBindingAsymmetricSAML1Policy" />
+		<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="DoubleItAsymmetricSAML2Binding" type="tns:DoubleItPortType">
+		<wsp:PolicyReference URI="#DoubleItBindingAsymmetricSAML2Policy" />
+		<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:service name="DoubleItService">
+		<wsdl:port name="DoubleItAsymmetricSAML1Port" binding="tns:DoubleItAsymmetricSAML1Binding">
+			<soap:address
+				location="http://localhost:8082/doubleit/services/doubleitasymmetricsaml1" />
+		</wsdl:port>
+		<wsdl:port name="DoubleItAsymmetricSAML2Port" binding="tns:DoubleItAsymmetricSAML2Binding">
+			<soap:address
+				location="http://localhost:8082/doubleit/services/doubleitasymmetricsaml2" />
+		</wsdl:port>
+		<wsdl:port name="DoubleItAsymmetricSAML1EncryptedPort"
+			binding="tns:DoubleItAsymmetricSAML1Binding">
+			<soap:address
+				location="http://localhost:8082/doubleit/services/doubleitasymmetricsaml1encrypted" />
+		</wsdl:port>
+	</wsdl:service>
+	
+	<wsp:Policy wsu:Id="DoubleItBindingAsymmetricSAML1Policy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<wsam:Addressing wsp:Optional="false">
+					<wsp:Policy />
+				</wsam:Addressing>
+				<sp:AsymmetricBinding>
+					<wsp:Policy>
+						<sp:InitiatorToken>
+							<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/
+										</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: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:Basic256 />
+							</wsp:Policy>
+						</sp:AlgorithmSuite>
+					</wsp:Policy>
+				</sp:AsymmetricBinding>
+				<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="DoubleItBindingAsymmetricSAML2Policy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<wsam:Addressing wsp:Optional="false">
+					<wsp:Policy />
+				</wsam:Addressing>
+				<sp:AsymmetricBinding>
+					<wsp:Policy>
+						<sp:InitiatorToken>
+							<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#SAMLV2.0</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/
+										</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: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:Basic256 />
+							</wsp:Policy>
+						</sp:AlgorithmSuite>
+					</wsp:Policy>
+				</sp:AsymmetricBinding>
+				<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="DoubleItBinding_DoubleIt_Input_Policy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<sp:EncryptedParts>
+					<sp:Body />
+				</sp:EncryptedParts>
+				<sp:SignedParts>
+					<sp:Body />
+					<sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="AckRequested"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="SequenceAcknowledgement"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="Sequence"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="CreateSequence"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+				</sp:SignedParts>
+			</wsp:All>
+		</wsp:ExactlyOne>
+	</wsp:Policy>
+	<wsp:Policy wsu:Id="DoubleItBinding_DoubleIt_Output_Policy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<sp:EncryptedParts>
+					<sp:Body />
+				</sp:EncryptedParts>
+				<sp:SignedParts>
+					<sp:Body />
+					<sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="AckRequested"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="SequenceAcknowledgement"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="Sequence"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="CreateSequence"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+				</sp:SignedParts>
+			</wsp:All>
+		</wsp:ExactlyOne>
+	</wsp:Policy>
+</wsdl:definitions>

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-client.xml?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-client.xml (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-client.xml Mon Oct 17 16:15:04 2011
@@ -0,0 +1,147 @@
+<!--
+ 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}DoubleItAsymmetricSAML1Port" 
+                  createdFromAPI="true">
+       <jaxws:properties>
+           <entry key="ws-security.signature.properties" value="clientKeystore.properties"/>
+           <entry key="ws-security.signature.username" value="myclientkey"/>
+           <entry key="ws-security.callback-handler" 
+                  value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
+           <entry key="ws-security.encryption.properties" value="clientKeystore.properties"/> 
+           <entry key="ws-security.encryption.username" value="myservicekey"/>
+           <entry key="ws-security.sts.client">
+               <bean class="org.apache.cxf.ws.security.trust.STSClient">
+                   <constructor-arg ref="cxf"/>
+                   <property name="wsdlLocation" 
+                             value="http://localhost:8080/SecurityTokenService/UT?wsdl"/>
+                   <property name="serviceName" 
+                             value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"/>
+                   <property name="endpointName" 
+                             value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}UT_Port"/>
+                   <property name="properties">
+                       <map>
+                           <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.encryption.properties" value="clientKeystore.properties"/> 
+                           <entry key="ws-security.encryption.username" value="mystskey"/>
+                           <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"/> 
+                           <entry key="ws-security.is-bsp-compliant" value="false"/>
+                       </map>
+                   </property>
+               </bean>            
+           </entry> 
+       </jaxws:properties>
+   </jaxws:client>
+   
+   <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItAsymmetricSAML2Port" 
+                  createdFromAPI="true">
+       <jaxws:properties>
+           <entry key="ws-security.signature.properties" value="clientKeystore.properties"/>
+           <entry key="ws-security.signature.username" value="myclientkey"/>
+           <entry key="ws-security.callback-handler" 
+                  value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
+           <entry key="ws-security.encryption.properties" value="clientKeystore.properties"/> 
+           <entry key="ws-security.encryption.username" value="myservicekey"/>
+           <entry key="ws-security.sts.client">
+               <bean class="org.apache.cxf.ws.security.trust.STSClient">
+                   <constructor-arg ref="cxf"/>
+                   <property name="wsdlLocation" 
+                             value="http://localhost:8080/SecurityTokenService/UT?wsdl"/>
+                   <property name="serviceName" 
+                             value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"/>
+                   <property name="endpointName" 
+                             value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}UT_Port"/>
+                   <property name="properties">
+                       <map>
+                           <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.encryption.properties" value="clientKeystore.properties"/> 
+                           <entry key="ws-security.encryption.username" value="mystskey"/>
+                           <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"/> 
+                           <entry key="ws-security.is-bsp-compliant" value="false"/>
+                       </map>
+                   </property>
+               </bean>            
+           </entry> 
+       </jaxws:properties>
+   </jaxws:client>
+   
+   <jaxws:client name="{http://www.example.org/contract/DoubleIt}DoubleItAsymmetricSAML1EncryptedPort" 
+                  createdFromAPI="true">
+       <jaxws:properties>
+           <entry key="ws-security.signature.properties" value="clientKeystore.properties"/>
+           <entry key="ws-security.signature.username" value="myclientkey"/>
+           <entry key="ws-security.callback-handler" 
+                  value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
+           <entry key="ws-security.encryption.properties" value="clientKeystore.properties"/> 
+           <entry key="ws-security.encryption.username" value="myservicekey"/>
+           <entry key="ws-security.sts.client">
+               <bean class="org.apache.cxf.ws.security.trust.STSClient">
+                   <constructor-arg ref="cxf"/>
+                   <property name="wsdlLocation" 
+                             value="http://localhost:8080/SecurityTokenService/UTEncrypted?wsdl"/>
+                   <property name="serviceName" 
+                             value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"/>
+                   <property name="endpointName" 
+                             value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}UTEncrypted_Port"/>
+                   <property name="properties">
+                       <map>
+                           <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.encryption.properties" value="clientKeystore.properties"/> 
+                           <entry key="ws-security.encryption.username" value="mystskey"/>
+                           <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"/> 
+                           <entry key="ws-security.is-bsp-compliant" value="false"/>
+                       </map>
+                   </property>
+               </bean>            
+           </entry> 
+       </jaxws:properties>
+   </jaxws:client>
+   
+</beans>
+

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-service.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-service.xml?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-service.xml (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/asymmetric/cxf-service.xml Mon Oct 17 16:15:04 2011
@@ -0,0 +1,95 @@
+<!--
+ 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="doubleitasymmetricsaml1"
+      implementor="org.apache.cxf.systest.sts.common.DoubleItPortTypeImpl"
+      endpointName="s:DoubleItAsymmetricSAML1Port"
+      serviceName="s:DoubleItService"
+      address="http://localhost:${testutil.ports.Server}/doubleit/services/doubleitasymmetricsaml1"
+      wsdlLocation="org/apache/cxf/systest/sts/asymmetric/DoubleIt.wsdl"
+      xmlns:s="http://www.example.org/contract/DoubleIt">
+        
+      <jaxws:properties>
+         <entry key="ws-security.signature.username" value="myservicekey"/>
+         <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.encryption.properties" value="serviceKeystore.properties"/>
+      </jaxws:properties> 
+   </jaxws:endpoint>
+   
+   <jaxws:endpoint id="doubleitasymmetricsaml2"
+      implementor="org.apache.cxf.systest.sts.common.DoubleItPortTypeImpl"
+      endpointName="s:DoubleItAsymmetricSAML2Port"
+      serviceName="s:DoubleItService"
+      address="http://localhost:${testutil.ports.Server}/doubleit/services/doubleitasymmetricsaml2"
+      wsdlLocation="org/apache/cxf/systest/sts/asymmetric/DoubleIt.wsdl"
+      xmlns:s="http://www.example.org/contract/DoubleIt">
+        
+      <jaxws:properties>
+         <entry key="ws-security.signature.username" value="myservicekey"/>
+         <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.encryption.properties" value="serviceKeystore.properties"/>
+      </jaxws:properties> 
+   </jaxws:endpoint>
+   
+   <jaxws:endpoint id="doubleitasymmetricsaml1encrypted"
+      implementor="org.apache.cxf.systest.sts.common.DoubleItPortTypeImpl"
+      endpointName="s:DoubleItAsymmetricSAML1EncryptedPort"
+      serviceName="s:DoubleItService"
+      address="http://localhost:${testutil.ports.Server}/doubleit/services/doubleitasymmetricsaml1encrypted"
+      wsdlLocation="org/apache/cxf/systest/sts/asymmetric/DoubleIt.wsdl"
+      xmlns:s="http://www.example.org/contract/DoubleIt">
+        
+      <jaxws:properties>
+         <entry key="ws-security.signature.username" value="myservicekey"/>
+         <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.encryption.properties" value="serviceKeystore.properties"/>
+         <entry key="ws-security.is-bsp-compliant" value="false"/>
+      </jaxws:properties> 
+   </jaxws:endpoint>
+   
+</beans>
+

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/DoubleIt.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/DoubleIt.wsdl?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/DoubleIt.wsdl (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/DoubleIt.wsdl Mon Oct 17 16:15:04 2011
@@ -0,0 +1,184 @@
+<!--
+ 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.
+-->
+<wsdl:definitions name="DoubleIt"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:di="http://www.example.org/schema/DoubleIt"
+	xmlns:tns="http://www.example.org/contract/DoubleIt" xmlns:wsp="http://www.w3.org/ns/ws-policy"
+	xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
+	xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
+	xmlns:t="http://docs.oasis-open.org/ws-sx/ws-trust/200512" xmlns:wsaw="http://www.w3.org/2005/08/addressing"
+	xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" targetNamespace="http://www.example.org/contract/DoubleIt">
+
+    <wsdl:import location="src/test/resources/DoubleItLogical.wsdl" 
+                 namespace="http://www.example.org/contract/DoubleIt"/>
+
+	<wsdl:binding name="DoubleItTransportSAML2BearerBinding" type="tns:DoubleItPortType">
+		<wsp:PolicyReference URI="#DoubleItBindingTransportSAML2BearerPolicy" />
+		<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:service name="DoubleItService">
+		<wsdl:port name="DoubleItTransportSAML2BearerPort" 
+		           binding="tns:DoubleItTransportSAML2BearerBinding">
+			<soap:address
+				location="https://localhost:8081/doubleit/services/doubleittransportsaml2bearer" />
+		</wsdl:port>
+	</wsdl:service>
+	
+	<wsp:Policy wsu:Id="DoubleItBindingTransportSAML2BearerPolicy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<wsam:Addressing wsp:Optional="false">
+					<wsp:Policy />
+				</wsam:Addressing>
+				<sp:TransportBinding
+					xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
+					<wsp:Policy>
+						<sp:TransportToken>
+							<wsp:Policy>
+								<sp:HttpsToken RequireClientCertificate="false" />
+							</wsp:Policy>
+						</sp:TransportToken>
+						<sp:AlgorithmSuite>
+							<wsp:Policy>
+								<sp:TripleDesRsa15 />
+							</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>
+						<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#SAMLV2.0</t:TokenType>
+								<t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</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>
+					</wsp:Policy>
+				</sp:SignedSupportingTokens>
+				<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="DoubleItBinding_DoubleIt_Input_Policy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<sp:EncryptedParts>
+					<sp:Body />
+				</sp:EncryptedParts>
+				<sp:SignedParts>
+					<sp:Body />
+					<sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="AckRequested"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="SequenceAcknowledgement"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="Sequence"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="CreateSequence"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+				</sp:SignedParts>
+			</wsp:All>
+		</wsp:ExactlyOne>
+	</wsp:Policy>
+	<wsp:Policy wsu:Id="DoubleItBinding_DoubleIt_Output_Policy">
+		<wsp:ExactlyOne>
+			<wsp:All>
+				<sp:EncryptedParts>
+					<sp:Body />
+				</sp:EncryptedParts>
+				<sp:SignedParts>
+					<sp:Body />
+					<sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
+					<sp:Header Name="AckRequested"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="SequenceAcknowledgement"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="Sequence"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+					<sp:Header Name="CreateSequence"
+						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
+				</sp:SignedParts>
+			</wsp:All>
+		</wsp:ExactlyOne>
+	</wsp:Policy>
+</wsdl:definitions>

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-client.xml?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-client.xml (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-client.xml Mon Oct 17 16:15:04 2011
@@ -0,0 +1,77 @@
+<!--
+ 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}DoubleItTransportSAML2BearerPort" 
+                  createdFromAPI="true">
+       <jaxws:properties>
+           <entry key="ws-security.sts.client">
+               <bean class="org.apache.cxf.ws.security.trust.STSClient">
+                   <constructor-arg ref="cxf"/>
+                   <property name="wsdlLocation" 
+                             value="https://localhost:8443/SecurityTokenService/Transport?wsdl"/>
+                   <property name="serviceName" 
+                             value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}SecurityTokenService"/>
+                   <property name="endpointName" 
+                             value="{http://docs.oasis-open.org/ws-sx/ws-trust/200512/}Transport_Port"/>
+                   <property name="properties">
+                       <map>
+                           <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"/> 
+                       </map>
+                   </property>
+               </bean>            
+           </entry> 
+       </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/bearer/cxf-service.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-service.xml?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-service.xml (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-service.xml Mon Oct 17 16:15:04 2011
@@ -0,0 +1,88 @@
+<!--
+ 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="doubleittransportsaml2bearer"
+      implementor="org.apache.cxf.systest.sts.common.DoubleItPortTypeImpl"
+      endpointName="s:DoubleItTransportSAML2BearerPort"
+      serviceName="s:DoubleItService"
+      depends-on="ClientAuthHttpsSettings"
+      address="https://localhost:${testutil.ports.Server}/doubleit/services/doubleittransportsaml2bearer"
+      wsdlLocation="org/apache/cxf/systest/sts/bearer/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.is-bsp-compliant" value="false"/>
+      </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_NULL_.*</sec:include>
+        <sec:exclude>.*_DH_anon_.*</sec:exclude>
+        </sec:cipherSuitesFilter>
+      <sec:clientAuthentication want="true" required="true"/>
+    </httpj:tlsServerParameters>
+   </httpj:engine>
+  </httpj:engine-factory>
+  
+   <http:conduit name="https://localhost:8443/.*">
+      <http:tlsClientParameters disableCNCheck="true">
+        <sec:trustManagers>
+          <sec:keyStore type="jks" password="sspass" resource="servicestore.jks"/>
+        </sec:trustManagers>
+      </http:tlsClientParameters>
+   </http:conduit>
+</beans>
+

Added: cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-unsigned-client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-unsigned-client.xml?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-unsigned-client.xml (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/bearer/cxf-unsigned-client.xml Mon Oct 17 16:15:04 2011
@@ -0,0 +1,56 @@
+<!--
+ 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}DoubleItTransportSAML2BearerPort" 
+                  createdFromAPI="true">
+       <jaxws:properties>
+       </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/deployment/cxf-encrypted-ut.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml?rev=1185276&view=auto
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml (added)
+++ cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/deployment/cxf-encrypted-ut.xml Mon Oct 17 16:15:04 2011
@@ -0,0 +1,100 @@
+<!--
+  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: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://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+
+    <bean id="encryptedUtSTSProviderBean"
+		class="org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider">
+		<property name="issueOperation" ref="encryptedUtIssueDelegate"/>
+		<property name="validateOperation" ref="encryptedUtValidateDelegate"/>
+	</bean>	
+
+	<bean id="encryptedUtIssueDelegate"
+		class="org.apache.cxf.sts.operation.TokenIssueOperation">
+		<property name="tokenProviders" ref="encryptedUtSamlTokenProvider"/>
+		<property name="services" ref="encryptedUtService"/>
+		<property name="stsProperties" ref="encryptedUtSTSProperties"/>
+	</bean>
+	
+	<bean id="encryptedUtValidateDelegate"
+	    class="org.apache.cxf.sts.operation.TokenValidateOperation">
+	</bean>
+	
+	<bean id="encryptedUtSamlTokenProvider"
+		class="org.apache.cxf.sts.token.provider.SAMLTokenProvider">
+    </bean>
+    
+    <bean id="encryptedUtService"
+        class="org.apache.cxf.sts.service.StaticService">
+        <property name="endpoints" ref="encryptedUtEndpoints"/>
+    </bean>
+    
+    <util:list id="encryptedUtEndpoints">
+		<value>http://localhost:(\d)*/doubleit/services/doubleitasymmetricsaml1encrypted</value>
+	</util:list>
+	
+	<bean id="encryptedUtSTSProperties"
+	     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"/>
+    </bean>
+    
+	<jaxws:endpoint id="EncryptedUTSTS"
+		implementor="#encryptedUtSTSProviderBean"
+		address="http://localhost:8080/SecurityTokenService/UTEncrypted" 
+        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:UTEncrypted_Port">
+        <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"/>
+            <entry key="ws-security.signature.username" value="mystskey"/>
+        </jaxws:properties> 
+	</jaxws:endpoint>
+	
+
+</beans>
+



Mime
View raw message