Repository: syncope
Updated Branches:
  refs/heads/2_0_X 48ae5566d -> de73cb89f


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/de73cb89
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/de73cb89
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/de73cb89

Branch: refs/heads/2_0_X
Commit: de73cb89f71a44fa1f268517a7d38105d68398b1
Parents: 48ae556
Author: fmartelli <[email protected]>
Authored: Tue Nov 21 16:13:00 2017 +0100
Committer: fmartelli <[email protected]>
Committed: Tue Nov 21 16:13:00 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/de73cb89/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 6bd6182..8fe4e5a 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
@@ -109,6 +109,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
@@ -462,10 +463,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();
@@ -697,5 +700,4 @@ public class SAML2SPLogic extends 
AbstractSAML2Logic<AbstractBaseBean> {
 
         throw new UnresolvedReferenceException();
     }
-
 }

Reply via email to