You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/06/02 11:05:48 UTC

git commit: updated refs/heads/saml-production-grade to d80634c

Repository: cloudstack
Updated Branches:
  refs/heads/saml-production-grade 3f17bd19a -> d80634cc6 (forced update)


CLOUDSTACK-8457: add debug statements when going through list of attributes

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d80634cc
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d80634cc
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d80634cc

Branch: refs/heads/saml-production-grade
Commit: d80634cc6a590d8485fbe75f3c81cae1c24ea619
Parents: e80c6a8
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Tue Jun 2 10:51:51 2015 +0200
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Jun 2 11:04:42 2015 +0200

----------------------------------------------------------------------
 .../saml2/src/org/apache/cloudstack/saml/SAMLUtils.java  | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d80634cc/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAMLUtils.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAMLUtils.java b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAMLUtils.java
index f9b6b2f..95cbefc 100644
--- a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAMLUtils.java
+++ b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAMLUtils.java
@@ -116,11 +116,12 @@ public class SAMLUtils {
                 continue;
             }
             for (Attribute attribute : attributeStatement.getAttributes()) {
-                if ((attributeKey.equals(attribute.getName())
-                        || attributeKey.equals(attribute.getFriendlyName()))
-                        && attribute.getAttributeValues() != null
-                        && attribute.getAttributeValues().size() > 0) {
-                    return attribute.getAttributeValues().get(0).getDOM().getTextContent();
+                if (attribute.getAttributeValues() != null && attribute.getAttributeValues().size() > 0) {
+                    String value = attribute.getAttributeValues().get(0).getDOM().getTextContent();
+                    s_logger.debug("SAML attribute name: " + attribute.getName() + " friendly-name:" + attribute.getFriendlyName() + " value:" + value);
+                    if (attributeKey.equals(attribute.getName()) || attributeKey.equals(attribute.getFriendlyName())) {
+                        return value;
+                    }
                 }
             }
         }