cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r724943 - in /cxf/sandbox/interopfest/wstrust10/src/main: java/interop/client/Client.java resources/etc/client.xml resources/etc/sts_policy_mut.xml resources/etc/sts_policy_ut.xml
Date Wed, 10 Dec 2008 00:52:26 GMT
Author: dkulp
Date: Tue Dec  9 16:52:26 2008
New Revision: 724943

URL: http://svn.apache.org/viewvc?rev=724943&view=rev
Log:
Start toward ws-trust

Added:
    cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_mut.xml   (with props)
    cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_ut.xml   (with props)
Modified:
    cxf/sandbox/interopfest/wstrust10/src/main/java/interop/client/Client.java
    cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/client.xml

Modified: cxf/sandbox/interopfest/wstrust10/src/main/java/interop/client/Client.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wstrust10/src/main/java/interop/client/Client.java?rev=724943&r1=724942&r2=724943&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wstrust10/src/main/java/interop/client/Client.java (original)
+++ cxf/sandbox/interopfest/wstrust10/src/main/java/interop/client/Client.java Tue Dec  9
16:52:26 2008
@@ -30,7 +30,16 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.ws.policy.EffectivePolicy;
+import org.apache.cxf.ws.policy.PolicyBuilder;
+import org.apache.cxf.ws.policy.PolicyEngine;
+import org.apache.cxf.ws.security.SecurityConstants;
 import org.apache.cxf.ws.security.tokenstore.SecurityToken;
+import org.apache.cxf.ws.security.trust.STSClient;
 
 import interopbaseaddress.interop.IPingService;
 
@@ -51,11 +60,9 @@
      */
     public static void main(String argv[])
         throws Exception {
-        if (argv.length < 1) {
-            System.err.println(
-                "SYNTAX: java Client <port-prefix>"
-            );
-            //argv = new String[] {"A"};
+        if (argv.length < 2) {
+            argv = new String[] {"Scenario_1_IssuedTokenOverTransport_UsernameOverTransport",
+                                 "/etc/sts_policy_ut.xml"};
         }
 
         Bus b = new SpringBusFactory().createBus("etc/client.xml");
@@ -67,35 +74,28 @@
         final IPingService port = 
             svc.getPort(
                 new QName(
-                    "http://InteropBaseAddress/interop",
-                    portPrefix + "_IPingService"
+                    "http://tempuri.org/",
+                    portPrefix
                 ),
                 IPingService.class
             );
         
-        //STSClient stsClient = new STSClient(b);
-        /*
-        Policy stsPolicy = loadPolicy(args[2]);
-        Policy servicePolicy = loadPolicy(args[4]);
-        
-        
-        //stsClient.setAddressingNs("http://www.w3.org/2005/08/addressing");
-        
-        stsClient.setAddressingNs(org.apache.axis2.addressing.AddressingConstants.Final.WSA_NAMESPACE);
-        stsClient.setRstTemplate(getRSTTemplate());
-        stsClient.setAction(RahasConstants.WST_NS_05_02 + RahasConstants.RST_ACTION_ISSUE);
-        stsClient.setSoapVersion(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
-        */
-        //SecurityToken responseToken = stsClient.requestSecurityToken();//servicePolicy,
args[3], stsPolicy, null);
-        
-        
-        /*
-        ((BindingProvider)port)
-            .getRequestContext()
-                .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
-                     "http://localhost:9001/" + portPrefix + "PingService");
-        */
+        PolicyBuilder pb = b.getExtension(PolicyBuilder.class);
+        STSClient stsClient = new STSClient(b);
+        stsClient.setPolicy(pb.getPolicy(Client.class.getResourceAsStream(argv[1])));
+        stsClient.setLocation("https://131.107.72.15/Security_Federation_SecurityTokenService_Indigo/Symmetric.svc/Scenario_1_IssuedTokenOverTransport_UsernameOverTransport");
+        stsClient.setSoap12();
+        
+        stsClient.getRequestContext().put(SecurityConstants.USERNAME, "Alice");
+        stsClient.getRequestContext().put(SecurityConstants.PASSWORD, "abcd!1234");
+        
+        //TODO: get the Trust10 token out of the port 
+        //Trust10 trust = ......
+        //stsClient.setTrust(trust);
         
+        SecurityToken responseToken = stsClient.requestSecurityToken();
+
+        //TODO: stick security token into the RequestContext/TokenStore
         final String output = port.echo(INPUT);
         if (!INPUT.equals(output)) {
             System.err.println(

Modified: cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/client.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/client.xml?rev=724943&r1=724942&r2=724943&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/client.xml (original)
+++ cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/client.xml Tue Dec  9 16:52:26
2008
@@ -24,148 +24,31 @@
             <cxf:logging/>
         </cxf:features>
     </cxf:bus>
-    <!-- -->
-    <!-- Scenario 4.1 -->
-    <!-- -->
-    <jaxws:client name="{http://InteropBaseAddress/interop}A_IPingService" createdFromAPI="true">
+    <http:conduit name="https://131.107.72.15/Security_Federation_FederatedService_Indigo/Symmetric.svc/Scenario_1_IssuedTokenOverTransport_UsernameOverTransport.*">
+        <http:tlsClientParameters disableCNCheck="true">
+            <sec:keyManagers keyPassword="password">
+                <sec:keyStore type="pkcs12" password="password" resource="certs/alice.pfx"/>
+            </sec:keyManagers>
+            <sec:trustManagers>
+                <sec:keyStore type="pkcs12" password="password" resource="certs/bob.pfx"/>
+            </sec:trustManagers>
+        </http:tlsClientParameters>
+    </http:conduit>
+    <http:conduit name="https://131.107.72.15/Security_Federation_SecurityTokenService_Indigo/Symmetric.svc/.*">
+        <http:tlsClientParameters disableCNCheck="true">
+            <sec:keyManagers keyPassword="password">
+                <sec:keyStore type="pkcs12" password="password" resource="certs/alice.pfx"/>
+            </sec:keyManagers>
+            <sec:trustManagers>
+                <sec:keyStore type="pkcs12" password="password" resource="certs/bob.pfx"/>
+            </sec:trustManagers>
+        </http:tlsClientParameters>
+    </http:conduit>
+    <!-- jaxws:client name="{http://InteropBaseAddress/interop}A_IPingService" createdFromAPI="true">
         <jaxws:properties>
             <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
             <entry key="ws-security.encryption.username" value="Bob"/>
             <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

         </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}A-NoTimestamp_IPingService"
createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}AD_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}A-ES_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}AD-ES_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-
-    <jaxws:client name="{http://InteropBaseAddress/interop}UX_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}UX-NoTimestamp_IPingService"
createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}UXD_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>    
-    <jaxws:client name="{http://InteropBaseAddress/interop}UX-SEES_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>    
-    <jaxws:client name="{http://InteropBaseAddress/interop}UXD-SEES_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>    
-    
-    <jaxws:client name="{http://InteropBaseAddress/interop}X_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}X-NoTimestamp_IPingService"
createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}X-AES128_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}X-AES192_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}X-TripleDES_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}XD_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-        <jaxws:client name="{http://InteropBaseAddress/interop}XD-ES_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>
-    <jaxws:client name="{http://InteropBaseAddress/interop}XD-SEES_IPingService" createdFromAPI="true">
-        <jaxws:properties>
-            <entry key="ws-security.username" value="Alice"/>
-            <entry key="ws-security.callback-handler" value="interop.client.KeystorePasswordCallback"/>
-            <entry key="ws-security.encryption.username" value="Bob"/>
-            <entry key="ws-security.encryption.properties" value="etc/bob.properties"/>

-        </jaxws:properties>
-    </jaxws:client>        
+    </jaxws:client-->
 </beans>

Added: cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_mut.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_mut.xml?rev=724943&view=auto
==============================================================================
--- cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_mut.xml (added)
+++ cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_mut.xml Tue Dec  9
16:52:26 2008
@@ -0,0 +1,71 @@
+<wsp:Policy wsu:Id="CustomBinding_ISecurityTokenService1_policy"
+            xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"

+            xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+            xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"
+            xmlns:wsaw="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy">
+	<wsp:ExactlyOne>
+		<wsp:All>
+			<sp:AsymmetricBinding>
+				<wsp:Policy>
+					<sp:InitiatorToken>
+						<wsp:Policy>
+							<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+								<wsp:Policy>
+									<sp:WssX509V3Token10/>
+								</wsp:Policy>
+							</sp:X509Token>
+						</wsp:Policy>
+					</sp:InitiatorToken>
+					<sp:RecipientToken>
+						<wsp:Policy>
+							<sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
+								<wsp:Policy>
+									<sp:WssX509V3Token10/>
+								</wsp:Policy>
+							</sp:X509Token>
+						</wsp:Policy>
+					</sp:RecipientToken>
+					<sp:AlgorithmSuite>
+						<wsp:Policy>
+							<sp:Basic256/>
+						</wsp:Policy>
+					</sp:AlgorithmSuite>
+					<sp:Layout>
+						<wsp:Policy>
+							<sp:Lax/>
+						</wsp:Policy>
+					</sp:Layout>
+					<sp:IncludeTimestamp/>
+					<sp:OnlySignEntireHeadersAndBody/>
+				</wsp:Policy>
+			</sp:AsymmetricBinding>
+			<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:SignedParts>
+			<sp:EncryptedParts>
+				<sp:Body/>
+			</sp:EncryptedParts>
+			<sp:Wss10>
+				<wsp:Policy>
+					<sp:MustSupportRefKeyIdentifier/>
+					<sp:MustSupportRefIssuerSerial/>
+				</wsp:Policy>
+			</sp:Wss10>
+			<sp:Trust10>
+				<wsp:Policy>
+					<sp:MustSupportIssuedTokens/>
+					<sp:RequireClientEntropy/>
+					<sp:RequireServerEntropy/>
+				</wsp:Policy>
+			</sp:Trust10>
+			<wsaw:UsingAddressing/>
+		</wsp:All>
+	</wsp:ExactlyOne>
+</wsp:Po
\ No newline at end of file

Propchange: cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_mut.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_mut.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_mut.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_ut.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_ut.xml?rev=724943&view=auto
==============================================================================
--- cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_ut.xml (added)
+++ cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_ut.xml Tue Dec  9
16:52:26 2008
@@ -0,0 +1,57 @@
+<!-- https://131.107.72.15/Security_Federation_SecurityTokenService_Indigo/Symmetric.svc/Scenario_1_IssuedTokenOverTransport_UsernameOverTransport
-->
+<wsp:Policy wsu:Id="CustomBinding_ISecurityTokenService_policy"
+		    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"

+            xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
+            xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy" 
+            xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
+            >
+	<wsp:ExactlyOne>
+		<wsp:All>
+			<sp:TransportBinding>
+				<wsp:Policy>
+					<sp:TransportToken>
+						<wsp:Policy>
+							<sp:HttpsToken RequireClientCertificate="false"/>
+						</wsp:Policy>
+					</sp:TransportToken>
+					<sp:AlgorithmSuite>
+						<wsp:Policy>
+							<sp:Basic256/>
+						</wsp:Policy>
+					</sp:AlgorithmSuite>
+					<sp:Layout>
+						<wsp:Policy>
+							<sp:Lax/>
+						</wsp:Policy>
+					</sp:Layout>
+					<sp:IncludeTimestamp/>
+				</wsp:Policy>
+			</sp:TransportBinding>
+			<sp:SignedSupportingTokens>
+				<wsp:Policy>
+					<sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
+						<wsp:Policy>
+							<sp:WssUsernameToken10/>
+						</wsp:Policy>
+					</sp:UsernameToken>
+				</wsp:Policy>
+			</sp:SignedSupportingTokens>
+			<sp:Wss11>
+				<wsp:Policy>
+					<sp:MustSupportRefKeyIdentifier/>
+					<sp:MustSupportRefIssuerSerial/>
+					<sp:MustSupportRefThumbprint/>
+					<sp:MustSupportRefEncryptedKey/>
+				</wsp:Policy>
+			</sp:Wss11>
+			<sp:Trust10>
+				<wsp:Policy>
+					<sp:MustSupportIssuedTokens/>
+					<sp:RequireClientEntropy/>
+					<sp:RequireServerEntropy/>
+				</wsp:Policy>
+			</sp:Trust10>
+			<wsaw:UsingAddressing/>
+		</wsp:All>
+	</wsp:ExactlyOne>
+</wsp:Policy>
\ No newline at end of file

Propchange: cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_ut.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_ut.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/sandbox/interopfest/wstrust10/src/main/resources/etc/sts_policy_ut.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message