Repository: syncope
Updated Branches:
  refs/heads/master 31f14930a -> b9cac817f


provides support for saml attribute type any (not just string)


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

Branch: refs/heads/master
Commit: b9cac817f8259895c7475a56c08d742f11174fd7
Parents: 31f1493
Author: fmartelli <[email protected]>
Authored: Tue Nov 21 16:13:00 2017 +0100
Committer: fmartelli <[email protected]>
Committed: Tue Nov 21 16:14:32 2017 +0100

----------------------------------------------------------------------
 .../org/apache/syncope/core/logic/SAML2SPLogic.java     | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/b9cac817/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/SAML2SPLogic.java
----------------------------------------------------------------------
diff --git 
a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/SAML2SPLogic.java
 
b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/SAML2SPLogic.java
index 4e40e83..72d04ed 100644
--- 
a/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/SAML2SPLogic.java
+++ 
b/ext/saml2sp/logic/src/main/java/org/apache/syncope/core/logic/SAML2SPLogic.java
@@ -107,6 +107,7 @@ import 
org.apache.syncope.core.provisioning.api.serialization.POJOHelper;
 import org.apache.syncope.core.spring.security.AuthContextUtils;
 import org.apache.syncope.core.spring.security.AuthDataAccessor;
 import org.apache.syncope.core.spring.security.Encryptor;
+import org.opensaml.core.xml.schema.XSAny;
 import org.springframework.util.ResourceUtils;
 
 @Component
@@ -460,10 +461,12 @@ public class SAML2SPLogic extends 
AbstractSAML2Logic<AbstractBaseBean> {
             for (Attribute attr : attrStmt.getAttributes()) {
                 if (!attr.getAttributeValues().isEmpty()) {
                     String attrName = attr.getFriendlyName() == null ? 
attr.getName() : attr.getFriendlyName();
-                    if 
(attrName.equals(idp.getConnObjectKeyItem().getExtAttrName())
-                            && attr.getAttributeValues().get(0) instanceof 
XSString) {
-
-                        keyValue = ((XSString) 
attr.getAttributeValues().get(0)).getValue();
+                    if 
(attrName.equals(idp.getConnObjectKeyItem().getExtAttrName())) {
+                        if (attr.getAttributeValues().get(0) instanceof 
XSString) {
+                            keyValue = ((XSString) 
attr.getAttributeValues().get(0)).getValue();
+                        } else if (attr.getAttributeValues().get(0) instanceof 
XSAny) {
+                            keyValue = ((XSAny) 
attr.getAttributeValues().get(0)).getTextContent();
+                        }
                     }
 
                     AttrTO attrTO = new AttrTO();
@@ -682,5 +685,4 @@ public class SAML2SPLogic extends 
AbstractSAML2Logic<AbstractBaseBean> {
 
         throw new UnresolvedReferenceException();
     }
-
 }

Reply via email to