LDAP Authenticator - mapping user's middle name

Hi,

  1. Is there a solution for the mapping of the user’s middle name in the XWiki user’s property (profile)?

When creating users manually, I assigned a first_name = user’s first name and middle name. And Full name display OK!

  1. How to do this in the LDAP application settings?
    LDAP mapping: first_name = givenName middleName does not work (see screenshot)

LDAP%20user%20fields%20mapping%20-%20middleName

This kind of mapping is not supported right now. You can only map an LDAP field to a XWiki user property.

It would probably not be very hard to implement since we do this kind of combination in other places but it require some dev. You should create a feature request on https://jira.xwiki.org/browse/LDAP.

If you want to give it a try I can give you some pointers.

Many thanks!
I opened the request [LDAP-66].
If you have time, then I can try your solution on my test XWiki.

I meant if you want to implement this feature. I won’t have time to work on it anytime soon but I can help you find your way in the LDAP authenticator code.

I did not understand you correctly, OK, I am ready to listen to your hints.

The actual mapping is applied in https://github.com/xwiki-contrib/ldap/blob/master/ldap-authenticator/src/main/java/org/xwiki/contrib/ldap/XWikiLDAPUtils.java#L1266 so I guess this method need to be rewritten to support pattern instead of simple names for the LDAP fields.

For the syntax I would use the same as in StrSubstitutor as in https://github.com/xwiki-contrib/ldap/blob/master/ldap-authenticator/src/main/java/org/xwiki/contrib/ldap/XWikiLDAPConfig.java#L1180 (so for your example you would enter in the configuration first_name=${givenName} ${moddleName}).

Thanks for the suggestion!
But I have a suspicion that the study of someone else’s code will take more time than the author of the code :slight_smile: I’ll take a look, but I’m not sure.

Is it possible to solve the problem through XWiki UI in this way:

  1. In the user profile class add the middle_name property.
  2. In the LDAP settings for mapping user properties: middle_name = middleName.

In version 9.7, I managed to add a field and fill it in from LDAP. The middle_name property is displayed in the user profile (only in the profile).

  1. Where in XWiki UI can you say: first_name = first_name middle_name ?

And which forum thread should I ask specific questions about working with application code, setting up the development environment, downloading code from GitHub, etc.?

At the moment I installed the development environment IDEA and cloned the repository https://github.com/xwiki-contrib/ldap. But I have a lot of code highlighted in red - not found classes, something else needs to be reloaded!

With pure Java and Web features did not work, only in terms of Android programming in Java: (

What dev documents to read in advance?

I guess the first thing to read would be https://dev.xwiki.org/xwiki/bin/view/Community/Building/. Then you have some IDEA related documentation on https://dev.xwiki.org/xwiki/bin/view/Community/BuildingInIdea.