ldap auth username atrib

ldap auth username atrib

by Johan Loubser -
Number of replies: 2
Hello i would like to setup ldap where username search is done agains cn (EDIR) and then the username field should be pulled from an unique ldap attrib.
The values of login username and username in moodle will not be the same.
Can this atrib mapping be done in config.

Moodle 3.3.3
apache
php5.6.33
postgresql9.6
Edir ldap


Average of ratings: -
In reply to Johan Loubser

Re: ldap auth username atrib

by Dave Perry -
Picture of Testers

I have to ask why - the whole point of LDAP, AD etc is you use one username for everything. OK, ignore Office 365 and ADFS, that is an awkward exception in some places (e.g. on site we just use our samaccountname, but in 365 we have to use our upn).

Practically, I believe you can edit the search filter to use your cn attribute, then tell the LDAP plugin that the username field in moodle will be a different one. But it seems a lot of hassle.

In reply to Johan Loubser

Re: ldap auth username atrib

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

In short, no, it can't be done. LDAP auth (and maybe a few of other parts in Moodle too) assumes that the login username and the username are one and the same value.

You would need to modify LDAP authentication plugin to achieve what you propose.

Saludos. Iñaki.