axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r392197 - in /webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security: rahas/STSRequester.java rahas/Sender.java trust/impl/SCTIssuer.java
Date Fri, 07 Apr 2006 06:15:03 GMT
Author: ruchithf
Date: Thu Apr  6 23:15:01 2006
New Revision: 392197

URL: http://svn.apache.org/viewcvs?rev=392197&view=rev
Log:
Use the RequestedAttachedReference if availabale, to refer to the SCT
(Use wss4j r-392195 or later)


Modified:
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/STSRequester.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Sender.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/impl/SCTIssuer.java

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/STSRequester.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/STSRequester.java?rev=392197&r1=392196&r2=392197&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/STSRequester.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/STSRequester.java
Thu Apr  6 23:15:01 2006
@@ -156,10 +156,15 @@
         }
         
         //Check for attached ref
-        OMElement reqAttRef = rstr.getFirstChildWithName(new QName(
+        OMElement reqAttElem = rstr.getFirstChildWithName(new QName(
                 Constants.WST_NS, Constants.REQUESTED_ATTACHED_REFERENCE));
-        OMElement reqUnattRef = rstr.getFirstChildWithName(new QName(
+        OMElement reqAttRef = reqAttElem == null ? null : reqAttElem
+                .getFirstElement();
+        
+        OMElement reqUnattElem = rstr.getFirstChildWithName(new QName(
                 Constants.WST_NS, Constants.REQUESTED_UNATTACHED_REFERENCE));
+        OMElement reqUnattRef = reqUnattElem == null ? null : reqUnattElem
+                .getFirstElement();
         
         token.setAttachedReference(reqAttRef);
         token.setUnattachedReference(reqUnattRef);

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Sender.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Sender.java?rev=392197&r1=392196&r2=392197&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Sender.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Sender.java
Thu Apr  6 23:15:01 2006
@@ -16,6 +16,7 @@
 
 package org.apache.axis2.security.rahas;
 
+import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.dom.jaxp.DocumentBuilderFactoryImpl;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axis2.AxisFault;
@@ -116,15 +117,18 @@
 
         SecurityContextToken sct = new SecurityContextToken((Element) doc
                 .importNode((Element) tempToken.getToken(), true));
-        if(sct == null) {
-            
-        }
-        String tokenId = sct.getID();
 
         // Derived key encryption
         WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt();
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
-        encrBuilder.setExternalKey(tempSecret, tokenId);
+        OMElement attachedReference = tempToken.getAttachedReference();
+        if(attachedReference != null) {
+            encrBuilder.setExternalKey(tempSecret, (Element) doc.importNode(
+                    (Element) attachedReference, true));
+        } else {
+            String tokenId = sct.getID();
+            encrBuilder.setExternalKey(tempSecret, tokenId);
+        }
         encrBuilder.build(doc, crypto, secHeader);
 
         WSSecurityUtil.prependChildElement(doc, secHeader.getSecurityHeader(),

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/impl/SCTIssuer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/impl/SCTIssuer.java?rev=392197&r1=392196&r2=392197&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/impl/SCTIssuer.java
(original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/trust/impl/SCTIssuer.java
Thu Apr  6 23:15:01 2006
@@ -247,7 +247,7 @@
                         Constants.WST_PREFIX), rstrElem);
         
         reqAttRef.addChild((OMElement) this.createSecurityTokenReference(doc,
-                sctId, Constants.TOK_TYPE_SCT));
+                "#" + sctId, Constants.TOK_TYPE_SCT));
         
         reqUnattRef.addChild((OMElement) this.createSecurityTokenReference(doc,
                 sct.getIdentifier(), Constants.TOK_TYPE_SCT));



Mime
View raw message