cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1505655 - in /cxf/trunk: rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/ services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/
Date Mon, 22 Jul 2013 11:05:53 GMT
Author: coheigea
Date: Mon Jul 22 11:05:52 2013
New Revision: 1505655

URL: http://svn.apache.org/r1505655
Log:
Fixed a streaming IssuedToken test

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
    cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java?rev=1505655&r1=1505654&r2=1505655&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractStaxBindingHandler.java
Mon Jul 22 11:05:52 2013
@@ -57,6 +57,8 @@ import org.apache.wss4j.common.Configura
 import org.apache.wss4j.common.ext.WSPasswordCallback;
 import org.apache.wss4j.common.ext.WSSecurityException;
 import org.apache.wss4j.common.saml.SAMLCallback;
+import org.apache.wss4j.common.saml.bean.KeyInfoBean;
+import org.apache.wss4j.common.saml.bean.SubjectBean;
 import org.apache.wss4j.dom.WSConstants;
 import org.apache.wss4j.policy.SP11Constants;
 import org.apache.wss4j.policy.SP12Constants;
@@ -325,6 +327,18 @@ public abstract class AbstractStaxBindin
                 config.put(ConfigurationConstants.ACTION, samlAction);
             }
             
+            // Mock up a Subject so that the SAMLTokenOutProcessor can get access to the
certificate
+            final SubjectBean subjectBean;
+            if (signed || endorsing) {
+                KeyInfoBean keyInfo = new KeyInfoBean();
+                keyInfo.setCertificate(secToken.getX509Certificate());
+                keyInfo.setEphemeralKey(secToken.getSecret());
+                subjectBean = new SubjectBean("", "", "");
+                subjectBean.setKeyInfo(keyInfo);
+            } else {
+                subjectBean = null;
+            }
+            
             CallbackHandler callbackHandler = new CallbackHandler() {
 
                 @Override
@@ -333,6 +347,7 @@ public abstract class AbstractStaxBindin
                         if (callback instanceof SAMLCallback) {
                             SAMLCallback samlCallback = (SAMLCallback)callback;
                             samlCallback.setAssertionElement(el);
+                            samlCallback.setSubject(subjectBean);
                         }
                     }
                 }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java?rev=1505655&r1=1505654&r2=1505655&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
Mon Jul 22 11:05:52 2013
@@ -239,7 +239,9 @@ public class StaxTransportBindingHandler
     ) throws Exception {
         if (token instanceof IssuedToken) {
             addIssuedToken((IssuedToken)token, getSecurityToken(), false, true);
-            doSignature(token, wrapper);
+            signPartsAndElements(wrapper.getSignedParts(), wrapper.getSignedElements());
+            
+            configureSignature(wrapper, token, false);
         /* TODO if (token instanceof SecureConversationToken
             || token instanceof SecurityContextToken
             || token instanceof SpnegoContextToken) {

Modified: cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java?rev=1505655&r1=1505654&r2=1505655&view=diff
==============================================================================
--- cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java
(original)
+++ cxf/trunk/services/sts/systests/basic/src/test/java/org/apache/cxf/systest/sts/transport/TransportBindingTest.java
Mon Jul 22 11:05:52 2013
@@ -233,7 +233,7 @@ public class TransportBindingTest extend
             TokenTestUtils.updateSTSPort((BindingProvider)transportSaml1Port, STSPORT);
         }
         SecurityTestUtil.enableStreaming(transportSaml1Port);
-        // TODO doubleIt(transportSaml1Port, 25);
+        doubleIt(transportSaml1Port, 25);
         
         ((java.io.Closeable)transportSaml1Port).close();
         bus.shutdown(true);



Mime
View raw message