Skip to content

Commit

Permalink
Capitalize names
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Aug 22, 2023
1 parent 8a39acf commit 71528b3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion mujina-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.openconext</groupId>
<artifactId>mujina</artifactId>
<version>8.0.3</version>
<version>8.0.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion mujina-idp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.openconext</groupId>
<artifactId>mujina</artifactId>
<version>8.0.3</version>
<version>8.0.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
8 changes: 5 additions & 3 deletions mujina-idp/src/main/java/mujina/idp/SsoController.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ private List<SAMLAttribute> attributes(Authentication authentication) {
Map<String, List<String>> replacements = new HashMap<>();
String mail = String.format("%s@%s",
uid.replaceAll("[^a-zA-Z0-9]", ""),
"example.com");
"example.com")
.toLowerCase();
String givenName = uid.substring(0, 1).toUpperCase() + uid.substring(1);
result.keySet().forEach(key -> {
String standardValue = standardAttributes.get(key);
List<String> resultValues = result.get(key);
Expand All @@ -117,10 +119,10 @@ private List<SAMLAttribute> attributes(Authentication authentication) {
switch (key) {
case "urn:mace:dir:attribute-def:cn":
case "urn:mace:dir:attribute-def:displayName":
replacements.put(key, List.of(uid + " Doe"));
replacements.put(key, List.of(givenName + " Doe"));
break;
case "urn:mace:dir:attribute-def:givenName":
replacements.put(key, List.of(uid));
replacements.put(key, List.of(givenName));
break;
case "urn:mace:dir:attribute-def:mail":
case "urn:mace:dir:attribute-def:eduPersonPrincipalName":
Expand Down
2 changes: 1 addition & 1 deletion mujina-sp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.openconext</groupId>
<artifactId>mujina</artifactId>
<version>8.0.3</version>
<version>8.0.4</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<groupId>org.openconext</groupId>
<artifactId>mujina</artifactId>
<version>8.0.3</version>
<version>8.0.4</version>
<packaging>pom</packaging>

<parent>
Expand Down

0 comments on commit 71528b3

Please sign in to comment.