I have Xwiki 14.6 with LDAP Authenticator 9.7.6
I’m facing a strange situation, where:
- two user pages have been correctly named using the LDAP user username;
- two other have instead been named with the user lastname and first name
- a last one instead (the most recently created) seems the ldap props have not been decoded and has a wrong name
I’m fairly sure (1) & (2) were created when my XWiki was at 14.2.1 (and LDAP Auth maybe at 9.7.5), while (3) is of there days (XWiki 14.6).
These are the parts of the config that should be relevant:
xwiki.cfg:xwiki.authentication.ldap.bind_DN=<LDAP user with admin rights>
xwiki.cfg:xwiki.authentication.ldap.user_search_fmt=(sAMAccountName={1})
xwiki.cfg:xwiki.authentication.ldap.UID_attr=cn
xwiki.cfg:xwiki.authentication.ldap.fields_mapping=last_name=sn,first_name=givenName
xwiki.cfg:xwiki.authentication.ldap.userPageName=${ldap.sAMAccountName}
The sAMAccountName
field is where usernames are stored, and for me is like ra…ma… (all lowercase letters), and it worked.
For the last config option, this is what the comment says:
#-# [Since 9.0]
#-# The XWiki page name pattern.
#-# The supported syntax is org.apache.commons.lang3.text.StrSubstitutor one,
#-# see http://commons.apache.org/proper/commons-lang/javadocs/api-3.0/org/apache/commons/lang3/text/StrSubstitutor.html for more details.
#-# Can use:
#-# * the LDAP fields listed in xwiki.authentication.ldap.fields_mapping by prefixing it with "ldap." as in ${ldap.givenName}
#-# The default is "${uid}".
#-# * xwiki.authentication.ldap.remoteUserParser regex groups
#-# * a properties defined in xwiki.authentication.ldap.remoteUserMapping
#-#
#-# [Since 9.5.5]
#-# The following suffixes can be added:
#-# * "._lowerCase": the lower case version of the string
#-# * "._upperCase": the upper case version of the string
#-# * "._clean": a version of the string stripped from ".", ":", ",", "@", "^", "/" characters and "\s" (all forms of white spaces).
#-# It can itself be suffixed with "._lowerCase" and "._upperCase".
#-#
#-# In this example the XWiki user profile page name will be of the form MYDOMAIN-myuid
# xwiki.authentication.ldap.userPageName=${domain}-${uid}
But I’m not sure what that means, I do not want to use the sAMAccountName
value in any of the profile fields.
Here’s how the user pages are shows:
(for case (2) you can see the two capital letters corresponding to the person lastname and first name)