cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1088630 - in /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers: AbstractBindingBuilder.java TransportBindingHandler.java
Date Mon, 04 Apr 2011 14:08:07 GMT
Author: coheigea
Date: Mon Apr  4 14:08:07 2011
New Revision: 1088630

URL: http://svn.apache.org/viewvc?rev=1088630&view=rev
Log:
Fixed remaining two (non-TLS) failing WS-Trust interop demos. 

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/TransportBindingHandler.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java?rev=1088630&r1=1088629&r2=1088630&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
Mon Apr  4 14:08:07 2011
@@ -504,11 +504,15 @@ public abstract class AbstractBindingBui
                     sig.setX509Certificate(secToken.getX509Certificate());
                     sig.setCustomTokenId(secToken.getId());
                     sig.setKeyIdentifierType(WSConstants.CUSTOM_KEY_IDENTIFIER);
-                    // TODO Add support for SAML2 here
-                    if (secToken.getTokenType() == null) {
+                    String tokenType = secToken.getTokenType();
+                    if (WSConstants.WSS_SAML_TOKEN_TYPE.equals(tokenType)) {
                         sig.setCustomTokenValueType(WSConstants.WSS_SAML_KI_VALUE_TYPE);
+                    } else if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType)) {
+                        sig.setCustomTokenValueType(WSConstants.WSS_SAML2_KI_VALUE_TYPE);
+                    } else if (tokenType != null) {
+                        sig.setCustomTokenValueType(tokenType);
                     } else {
-                        sig.setCustomTokenValueType(secToken.getTokenType());
+                        sig.setCustomTokenValueType(WSConstants.WSS_SAML_KI_VALUE_TYPE);
                     }
                     sig.setSignatureAlgorithm(binding.getAlgorithmSuite().getAsymmetricSignature());
                     sig.setSigCanonicalization(binding.getAlgorithmSuite().getInclusiveC14n());
@@ -1658,10 +1662,14 @@ public abstract class AbstractBindingBui
             }
             
         } else {
-            if (tok.getTokenType() != null) {
-                sig.setCustomTokenValueType(tok.getTokenType());
+            String tokenType = tok.getTokenType();
+            if (WSConstants.WSS_SAML_TOKEN_TYPE.equals(tokenType)) {
+                sig.setCustomTokenValueType(WSConstants.WSS_SAML_KI_VALUE_TYPE);
+            } else if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType)) {
+                sig.setCustomTokenValueType(WSConstants.WSS_SAML2_KI_VALUE_TYPE);
+            } else if (tokenType != null) {
+                sig.setCustomTokenValueType(tokenType);
             } else {
-                // TODO Add support for SAML2 here
                 sig.setCustomTokenValueType(WSConstants.WSS_SAML_KI_VALUE_TYPE);
             }
             sig.setKeyIdentifierType(WSConstants.CUSTOM_SYMM_SIGNING);

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/TransportBindingHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/TransportBindingHandler.java?rev=1088630&r1=1088629&r2=1088630&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/TransportBindingHandler.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/TransportBindingHandler.java
Mon Apr  4 14:08:07 2011
@@ -428,7 +428,6 @@ public class TransportBindingHandler ext
             WSSecSignature sig = new WSSecSignature(wssConfig);
             if (secTok.getTokenType() == null) {
                 sig.setCustomTokenId(secTok.getId());
-                // TODO Add support for SAML2 here
                 sig.setCustomTokenValueType(WSConstants.WSS_SAML_KI_VALUE_TYPE);
                 sig.setKeyIdentifierType(WSConstants.CUSTOM_KEY_IDENTIFIER);
             } else {
@@ -440,8 +439,14 @@ public class TransportBindingHandler ext
                     sig.setCustomTokenId(secTok.getWsuId());
                     sig.setKeyIdentifierType(WSConstants.CUSTOM_SYMM_SIGNING);
                 }
-                sig.setCustomTokenValueType(secTok.getTokenType());
-                sig.setCustomTokenValueType(secTok.getTokenType());
+                String tokenType = secTok.getTokenType();
+                if (WSConstants.WSS_SAML_TOKEN_TYPE.equals(tokenType)) {
+                    sig.setCustomTokenValueType(WSConstants.WSS_SAML_KI_VALUE_TYPE);
+                } else if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType)) {
+                    sig.setCustomTokenValueType(WSConstants.WSS_SAML2_KI_VALUE_TYPE);
+                } else {
+                    sig.setCustomTokenValueType(tokenType);
+                }
                 sig.setKeyIdentifierType(WSConstants.CUSTOM_SYMM_SIGNING);
             }
             Crypto crypto = null;



Mime
View raw message