ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1469299 - /webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
Date Thu, 18 Apr 2013 12:44:23 GMT
Author: coheigea
Date: Thu Apr 18 12:44:23 2013
New Revision: 1469299

URL: http://svn.apache.org/r1469299
Log:
Only write out STR if Saml Signed action is used

Modified:
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java?rev=1469299&r1=1469298&r2=1469299&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
(original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SAMLTokenOutputProcessor.java
Thu Apr 18 12:44:23 2013
@@ -290,7 +290,7 @@ public class SAMLTokenOutputProcessor ex
                                 securityToken.getX509Certificates(), getSecurityProperties().isUseSingleCert());
                     }
                     outputSamlAssertion(samlAssertionWrapper.toDOM(null), subOutputProcessorChain);
-                    if (senderVouches) {
+                    if (senderVouches && isSignedSamlAction()) {
                         outputSecurityTokenReference(subOutputProcessorChain, samlAssertionWrapper,
                                 securityTokenReferenceId, samlAssertionWrapper.getId());
                     }
@@ -299,6 +299,16 @@ public class SAMLTokenOutputProcessor ex
             }
         }
     }
+    
+    private boolean isSignedSamlAction() {
+        WSSSecurityProperties properties = (WSSSecurityProperties) getSecurityProperties();
+        for (int i = 0; i < properties.getOutAction().length; i++) {
+            if (WSSConstants.SAML_TOKEN_SIGNED.equals(action)) {
+                return true;
+            }
+        }
+        return false;
+    }
 
     private void outputSecurityTokenReference(
             OutputProcessorChain outputProcessorChain, SamlAssertionWrapper samlAssertionWrapper,



Mime
View raw message