[Moodle 3.5.2][LDAP] users sync job (auth_ldap\task\sync_task),The username cannot be blank

Re: [Moodle 3.5.2][LDAP] users sync job (auth_ldap\task\sync_task),The username cannot be blank

by Leon Stringer -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers

If I understand the issue correctly: you are synchronising users from an LDAP server but the Moodle synchronisation script is not completing successfully because it's encountering users which have have a blank value for the attribute you're using for the Moodle username?

I think you can set an LDAP filter in the Object class field on the LDAP server plugin settings page in Moodle. Although this field is supposed to be specifically to filter by object class, in my experience you can filter by any value here. You'll need to use the syntax for LDAP filters and work out the exact filter for your environment.

For example: if the LDAP username attribute is called uid then the filter might be (&(objectClass=*)(uid=*)) -- you would need to change this to the username attribute for your LDAP server. You'll probably need some trial and error to find the filter you need, e.g. you may need (&(objectClass=user)...) or similar value to get only the entries you need.

Hope this helps!

Average of ratings: Useful (1)