LDAP authentication in WordPress

Requirements

Install LDAP
Install WordPress from 2.2 to 3.4 version

Steps

1. Create Users and Groups in LDAP.
2. Install wpDirAuth plugin in WordPress.
3. Configure wpDirAuth plugin. Steps to do this.
(i) Go to Directory Auth from settings menu.
(ii) Enable Directory Authentication to Yes if you want that WordPress authenticate LDAP users.
(iii) Requires SSL Login to Yes if you want WordPress login to do encryption.
(iv) Directory servers(Domain Controllers) means DNS or IP address. In my case I installed LDAP on my local server that is localhost.
(v) Account Filter means attribute of LDAP which authenticates WordPress login. In my case I chose cn(common name).
(vi) Base DN(distinguish name) contains the name of LDAP group of users you used to register in WordPress. In my case I have given ou=people,dc=navdeep,dc=bagga. Where ou=people is LDAP group of users.
(vii) Bind DN value contain admin of LDAP. Below given command displays the admin of your LDAP.

$ ldapsearch -x -b dc=debuntu,dc=local

In my case it is cn=admin,dc=navdeep,dc=bagga

(viii) Bind Password is a password of LDAP.

4. Save your settings by clicking on Update Options.
5. Go to Users menu and Click on ‘Add Directory Authenticated User’.
6. To register your LDAP user in WordPress, give filter attribute value in SSOID field which you have given in Account filter at the time you have configured plugin.In my case I have given name neha which is the value of cn in my LDAP. Define your role which you want to give to that member. Click on Add New User.
7. Open your login window in WordPress. Give ldap Username and password which you have registered in WordPress(step 6).

2 thoughts on “LDAP authentication in WordPress”

Leave a Reply

Your email address will not be published. Required fields are marked *