ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1051210 - in /webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message: WSSecEncrypt.java token/SecurityTokenReference.java
Date Mon, 20 Dec 2010 17:05:22 GMT
Author: coheigea
Date: Mon Dec 20 17:05:21 2010
New Revision: 1051210

URL: http://svn.apache.org/viewvc?rev=1051210&view=rev
Log:
[WSS-260] - WSS4J now calls back to a CallbackHandler to get SAML Assertions tha
t are not in the message.
 - Also fixing a regression in WSSecEncrypt.

Modified:
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/WSSecEncrypt.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/WSSecEncrypt.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/WSSecEncrypt.java?rev=1051210&r1=1051209&r2=1051210&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/WSSecEncrypt.java
(original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/WSSecEncrypt.java
Mon Dec 20 17:05:21 2010
@@ -499,7 +499,6 @@ public class WSSecEncrypt extends WSSecE
     private KeyInfo createKeyInfo() throws WSSecurityException {
 
         KeyInfo keyInfo = new KeyInfo(document);
-
         if (keyIdentifierType == WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER) {
             SecurityTokenReference secToken = new SecurityTokenReference(document);
             secToken.addWSSENamespace();
@@ -515,6 +514,7 @@ public class WSSecEncrypt extends WSSecE
         } else if (SecurityTokenReference.SAML_ID_URI.equals(customReferenceValue)) {
             SecurityTokenReference secToken = new SecurityTokenReference(document);
             secToken.setSAMLKeyIdentifier((encKeyIdDirectId ? "":"#") + encKeyId);
+            keyInfo.addUnknownElement(secToken.getElement());
         } else if (securityTokenReference != null) {
             Element tmpE = securityTokenReference.getElement();
             tmpE.setAttributeNS(

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java?rev=1051210&r1=1051209&r2=1051210&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java
(original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java
Mon Dec 20 17:05:21 2010
@@ -261,7 +261,8 @@ public class SecurityTokenReference {
         // 
         // Try to find a custom token
         //
-        if (WSConstants.WSC_SCT.equals(type) && cb != null) {
+        if (cb != null && (WSConstants.WSC_SCT.equals(type) ||
+            WSConstants.WSS_SAML_KI_VALUE_TYPE.equals(type) || assertionStr.equals(type)))
{
             //try to find a custom token
             WSPasswordCallback pwcb = 
                 new WSPasswordCallback(id, WSPasswordCallback.CUSTOM_TOKEN);



Mime
View raw message