Commit 7dbfa56d authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

1204: Fix minor issues for 3.9 release

Task-Url: https://pm.winseda.de/issues/1204
parent 5895e7f2
Pipeline #7416 passed with stages
in 2 minutes and 42 seconds
......@@ -8,6 +8,7 @@ import org.joda.time.DateTime;
import org.opensaml.saml2.core.Attribute;
import org.opensaml.saml2.core.NameID;
import org.opensaml.xml.XMLObject;
import org.opensaml.xml.schema.XSAny;
import org.opensaml.xml.schema.XSString;
import org.opensaml.xml.schema.impl.XSStringImpl;
import org.slf4j.Logger;
......@@ -75,8 +76,6 @@ public abstract class BaseUserService implements UserService, SAMLUserDetailsSer
if (u instanceof SAMLUserImpl) {
uPersisted.setHasAllAttributes(((SAMLUserImpl)u).isHasAllAttributes());
}
u = uPersisted;
}
......@@ -141,9 +140,13 @@ public abstract class BaseUserService implements UserService, SAMLUserDetailsSer
if (attr.getAttributeValues()!=null && attr.getAttributeValues().size()>0) {
for (XMLObject a : attr.getAttributeValues()) {
if (a instanceof XSString) {
if (XSString.class.isAssignableFrom(a.getClass()) || XSAny.class.isAssignableFrom(a.getClass())) {
r = new RoleImpl();
r.setAuthority(((XSString)a).getValue().trim().toLowerCase());
if (XSString.class.isAssignableFrom(a.getClass())) {
r.setAuthority(((XSString)a).getValue().trim().toLowerCase());
} else {
r.setAuthority(((XSAny)a).getTextContent().trim().toLowerCase());
}
roles.add(r);
}
}
......@@ -223,6 +226,8 @@ public abstract class BaseUserService implements UserService, SAMLUserDetailsSer
XMLObject attrValue = attrValues.get(0);
if (attrValue instanceof XSString) {
return ((XSString)attrValue).getValue();
} else if (attrValue instanceof XSAny) {
return ((XSAny)attrValue).getTextContent();
}
throw new Exception("Unexpected value type; Expected XSString, received: " + attrValue.getClass().toString());
}
......
......@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>eu.dariah.de</groupId>
<artifactId>dariahsp</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>1.2.1-SNAPSHOT</version>
<name>dariahsp - parent pom</name>
<description>Metapackage for the DARIAH Service Provider (dariahsp) library</description>
<packaging>pom</packaging>
......@@ -20,7 +20,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<eu.dariah.de.dariahsp.dariahsp-core.version>1.2.2-SNAPSHOT</eu.dariah.de.dariahsp.dariahsp-core.version>
<eu.dariah.de.dariahsp.dariahsp-core.version>1.2.3-SNAPSHOT</eu.dariah.de.dariahsp.dariahsp-core.version>
<eu.dariah.de.dariahsp.dariahsp-sample.version>1.2.0-SNAPSHOT</eu.dariah.de.dariahsp.dariahsp-sample.version>
<de.unibamberg.minf.core.core-metamodel.version>4.2.4-SNAPSHOT</de.unibamberg.minf.core.core-metamodel.version>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment