Author: coheigea
Date: Wed Dec  4 13:17:41 2013
New Revision: 1547794

URL: http://svn.apache.org/r1547794
Log:
Add a test for validating SAML Tokens to the STS

Modified:
    
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-service.xml
    
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-stax-service.xml

Modified: 
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-service.xml
URL: 
http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-service.xml?rev=1547794&r1=1547793&r2=1547794&view=diff
==============================================================================
--- 
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-service.xml
 (original)
+++ 
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-service.xml
 Wed Dec  4 13:17:41 2013
@@ -19,6 +19,29 @@
 -->
 <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"/>
+    
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    
+    <bean id="stsclient" class="org.apache.cxf.ws.security.trust.STSClient">
+        <constructor-arg ref="cxf"/>
+        <property name="wsdlLocation" 
value="http://localhost:${testutil.ports.STSServer.2}/SecurityTokenService/X509?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/}X509_Port"/>
+        <property name="properties">
+            <map>
+                <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.encryption.username" value="mystskey"/>
+            </map>
+        </property>
+    </bean>
+    
     <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"; 
id="doubleitsymmetricsaml1" 
implementor="org.apache.cxf.systest.sts.common.DoubleItPortTypeImpl" 
endpointName="s:DoubleItSymmetricSAML1Port" serviceName="s:DoubleItService" 
address="http://localhost:${testutil.ports.Server}/doubleit/services/doubleitsymmetricsaml1";
 wsdlLocation="org/apache/cxf/systest/sts/x509_symmetric/DoubleIt.wsdl">
         <jaxws:properties>
             <entry key="ws-security.callback-handler" 
value="org.apache.cxf.systest.sts.common.CommonCallbackHandler"/>
@@ -35,7 +58,12 @@
             <entry key="ws-security.signature.properties" 
value="serviceKeystore.properties"/>
             <entry key="ws-security.is-bsp-compliant" value="false"/>
             <entry key="ws-security.saml2.validator">
-                <bean 
class="org.apache.cxf.ws.security.trust.STSTokenValidator"/>
+                <bean 
class="org.apache.cxf.ws.security.trust.STSTokenValidator">
+                    <constructor-arg value="true"/>
+                </bean>
+            </entry>
+            <entry key="ws-security.sts.client">
+                <ref bean="stsclient"/>
             </entry>
         </jaxws:properties>
     </jaxws:endpoint>

Modified: 
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-stax-service.xml
URL: 
http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-stax-service.xml?rev=1547794&r1=1547793&r2=1547794&view=diff
==============================================================================
--- 
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-stax-service.xml
 (original)
+++ 
cxf/trunk/services/sts/systests/basic/src/test/resources/org/apache/cxf/systest/sts/x509_symmetric/cxf-stax-service.xml
 Wed Dec  4 13:17:41 2013
@@ -19,13 +19,41 @@
 -->
 <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"/>
+    
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    
+    <bean id="stsclient" class="org.apache.cxf.ws.security.trust.STSClient">
+        <constructor-arg ref="cxf"/>
+        <property name="wsdlLocation" 
value="http://localhost:${testutil.ports.StaxSTSServer.2}/SecurityTokenService/X509?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/}X509_Port"/>
+        <property name="properties">
+            <map>
+                <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.encryption.username" value="mystskey"/>
+            </map>
+        </property>
+    </bean>
+    
     <jaxws:endpoint xmlns:s="http://www.example.org/contract/DoubleIt"; 
id="doubleitsymmetricsaml1" 
implementor="org.apache.cxf.systest.sts.common.DoubleItPortTypeImpl" 
endpointName="s:DoubleItSymmetricSAML1Port" serviceName="s:DoubleItService" 
address="http://localhost:${testutil.ports.StaxServer}/doubleit/services/doubleitsymmetricsaml1";
 wsdlLocation="org/apache/cxf/systest/sts/x509_symmetric/DoubleIt.wsdl">
         <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"/>
             <entry key="ws-security.saml1.validator">
-                <bean 
class="org.apache.cxf.ws.security.trust.STSStaxTokenValidator"/>
+                <bean 
class="org.apache.cxf.ws.security.trust.STSStaxTokenValidator">
+                    <constructor-arg value="true"/>
+                </bean>
+            </entry>
+            <entry key="ws-security.sts.client">
+                <ref bean="stsclient"/>
             </entry>
             <entry key="ws-security.enable.streaming" value="true"/>
         </jaxws:properties>


Reply via email to