How to Integrate Moodle with LDAP
In this post we will discuss the steps to integrate Moodle with LDAP. In our case we are using 389DS as our LDAP server. Please follow the steps below for the integration
- First enable the Authentication plugin. To do so navigate to Site administration–>Plugins–>Authentication–>Manage authentication as shown in the screen shot below
2. You will see another screen where you have to enable the LDAP server plugin as shown in image below
3. Once the plugin is enabled you need to click on the settings link on the same page as shown in the image above. You will see the LDAP server setting page where you can configure the LDAP server details. Please check the configurable options below
- Host URL: Here you have to provide the LDAP server ip or hostname in this format ldap://192.168.1.100. you can also provide multiple LDAP server by delimiting the server with ‘;’ e.g ldap://192.168.1.100;ldap://192.168.1.200
- Version of you ldap server in my case it is 3
- LDAP encoding usually it is utf-8 but in case you are using some other you can provide that.
- In Bind settings just select hide password as yes and provide the DN (cn=manager) password (secret)
- User lookup settings. User type should be default and provide the contexts(required to locate the users) like ou=Student,dc=example,dc=com;ou=Teacher,dc=example,dc=com. Search subcontexts should be yes in case u have sub ou.
- User attribute should be provided which is used for name search In our case it is uid
- Now you have to map the data like first name, email address etc. for that you should know the attributes you have used in LDAP here are few example
- First name –> givenname
- Surname–> sn
- Email address –> mail
- Hit Save
That’s all you are done binding moodle with LDAP server. You can test it with one LDAP account and verify if all the necessary attributes are mapped. Hope this will help you. Do let us know in case you need to know about any other integration for moodle.