diff --git a/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/ConfluenceGroupLDAPStorageMapper.java b/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/ConfluenceGroupLDAPStorageMapper.java index ce093f9..a71bf6d 100644 --- a/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/ConfluenceGroupLDAPStorageMapper.java +++ b/src/main/java/org/vaulttec/keycloak/ldap/mappers/confluence/ConfluenceGroupLDAPStorageMapper.java @@ -195,10 +195,14 @@ private List getMappedPages(String firstName, String lastName) { } /** - * If username specified as ", " then convert to " ". + * Remove title (Dr.), diacritics (like accents) and if username specified as ", " then convert to " ". */ public static Function normalizeUsername() { return username -> { + if (username.startsWith("Dr. ")) { + username = username.substring(4); + } +// username = Normalizer.normalize(username, Normalizer.Form.NFKD).replaceAll("\\p{M}", ""); int delimiterPos = username.indexOf(","); if (delimiterPos >= 0) { return username.substring(delimiterPos + 1).trim() + " " + username.substring(0, delimiterPos).trim();