cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1071653 - /cxf/branches/2.3.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Date Thu, 17 Feb 2011 15:44:18 GMT
Author: coheigea
Date: Thu Feb 17 15:44:17 2011
New Revision: 1071653

URL: http://svn.apache.org/viewvc?rev=1071653&view=rev
Log:
Merged ID attribute fix from trunk.

Modified:
    cxf/branches/2.3.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java

Modified: cxf/branches/2.3.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java?rev=1071653&r1=1071652&r2=1071653&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Thu Feb 17 15:44:17 2011
@@ -121,6 +121,7 @@ import org.apache.xml.security.keys.cont
  */
 public class STSClient implements Configurable, InterceptorProvider {
     private static final Logger LOG = LogUtils.getL7dLogger(STSClient.class);
+    private static final String SAML2_NS = "urn:oasis:names:tc:SAML:2.0:assertion";
     
     Bus bus;
     String name = "default.sts-client";
@@ -1002,7 +1003,17 @@ public class STSClient implements Config
     private String findID(Element rar, Element rur, Element rst) {
         String id = null;
         if (rst != null) {
-            id = this.getIDFromSTR(rst);
+            QName elName = DOMUtils.getElementQName(rst);
+            if (elName.equals(new QName(WSConstants.SAML_NS, "Assertion"))
+                && rst.hasAttributeNS(null, "AssertionID")) {
+                id = rst.getAttributeNS(null, "AssertionID");
+            } else if (elName.equals(new QName(SAML2_NS, "Assertion"))
+                && rst.hasAttributeNS(null, "ID")) {
+                id = rst.getAttributeNS(null, "ID");
+            }
+            if (id == null) {
+                id = this.getIDFromSTR(rst);
+            }
         }
         if (id == null && rar != null) {
             id = this.getIDFromSTR(rar);



Mime
View raw message