diff --git a/mujina-common/pom.xml b/mujina-common/pom.xml
index a459971b..94c1a7b4 100644
--- a/mujina-common/pom.xml
+++ b/mujina-common/pom.xml
@@ -21,7 +21,7 @@
org.openconext
mujina
- 8.0.6
+ 8.0.7
../pom.xml
diff --git a/mujina-idp/pom.xml b/mujina-idp/pom.xml
index 769d41ec..7780f0c6 100644
--- a/mujina-idp/pom.xml
+++ b/mujina-idp/pom.xml
@@ -21,7 +21,7 @@
org.openconext
mujina
- 8.0.6
+ 8.0.7
../pom.xml
diff --git a/mujina-idp/src/main/java/mujina/idp/UserController.java b/mujina-idp/src/main/java/mujina/idp/UserController.java
index ffeddd13..034d0e2a 100644
--- a/mujina-idp/src/main/java/mujina/idp/UserController.java
+++ b/mujina-idp/src/main/java/mujina/idp/UserController.java
@@ -1,5 +1,6 @@
package mujina.idp;
+import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -10,9 +11,13 @@
import org.springframework.web.bind.annotation.GetMapping;
import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.Comparator;
import java.util.List;
import java.util.Map;
+import static java.util.Comparator.comparing;
+
@Controller
public class UserController {
@@ -25,7 +30,9 @@ public UserController(ObjectMapper objectMapper,
DefaultResourceLoader loader = new DefaultResourceLoader();
this.samlAttributes = objectMapper.readValue(
- loader.getResource(samlAttributesConfigFile).getInputStream(), List.class);
+ loader.getResource(samlAttributesConfigFile).getInputStream(), new TypeReference<>() {
+ });
+ this.samlAttributes.sort(comparing(m -> m.get("id")));
}
@GetMapping("/")
diff --git a/mujina-idp/src/main/resources/templates/login.html b/mujina-idp/src/main/resources/templates/login.html
index c6e5a2a5..1035b4e6 100644
--- a/mujina-idp/src/main/resources/templates/login.html
+++ b/mujina-idp/src/main/resources/templates/login.html
@@ -59,7 +59,8 @@
Mujina Identity Provider
diff --git a/mujina-sp/pom.xml b/mujina-sp/pom.xml
index 6c866318..ac0f6432 100644
--- a/mujina-sp/pom.xml
+++ b/mujina-sp/pom.xml
@@ -21,7 +21,7 @@
org.openconext
mujina
- 8.0.6
+ 8.0.7
../pom.xml
diff --git a/mujina-sp/src/main/java/mujina/sp/DefaultSAMLUserDetailsService.java b/mujina-sp/src/main/java/mujina/sp/DefaultSAMLUserDetailsService.java
index 8eb9fd6f..674d9a53 100755
--- a/mujina-sp/src/main/java/mujina/sp/DefaultSAMLUserDetailsService.java
+++ b/mujina-sp/src/main/java/mujina/sp/DefaultSAMLUserDetailsService.java
@@ -13,6 +13,7 @@
import java.util.List;
import java.util.Optional;
+import static java.util.Comparator.comparing;
import static java.util.stream.Collectors.toList;
public class DefaultSAMLUserDetailsService implements SAMLUserDetailsService {
@@ -28,7 +29,7 @@ public Principal loadUserBySAML(SAMLCredential credential) {
attribute.getName(),
attribute.getAttributeValues().stream().map(SAMLBuilder::getStringValueFromXMLObject)
.filter(Optional::isPresent).map(Optional::get).collect(toList()))).collect(toList());
-
+ attributes.sort(comparing(SAMLAttribute::getName));
NameID nameID = credential.getNameID();
return new SAMLPrincipal(nameID.getValue(), nameID.getFormat(), attributes);
}
diff --git a/pom.xml b/pom.xml
index 6ef20f05..1fa56579 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@
org.openconext
mujina
- 8.0.6
+ 8.0.7
pom