{"id":4987,"date":"2020-02-01T19:56:23","date_gmt":"2020-02-01T16:56:23","guid":{"rendered":"https:\/\/kifarunix.com\/?p=4987"},"modified":"2024-03-14T19:28:56","modified_gmt":"2024-03-14T16:28:56","slug":"how-to-configure-dokuwiki-openldap-authentication","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/how-to-configure-dokuwiki-openldap-authentication\/","title":{"rendered":"How to Configure DokuWiki OpenLDAP Authentication"},"content":{"rendered":"\n
In this tutorial, you will learn how to configure DokuWiki OpenLDAP authentication. How can I configure DokuWiki to enable authentication against OpenLDAP server. In this guide, we are going to learn how to configure DokuWiki for OpenLDAP authentication.<\/p>\n\n\n\n
Before you can proceed, ensure that you got OpenLDAP server and DokuWiki installed. Follow the guides below to learn how to setup OpenLDAP and how to install DokuWiki on CentOS 8.<\/p>\n\n\n\n
Install and Setup OpenLDAP on CentOS 8<\/a><\/p>\n\n\n\n Install DokuWiki on CentOS 8<\/a><\/p>\n\n\n\n In order to be able to connect to OpenLDAP server, you need to install PHP LDAP module by running the command below;<\/p>\n\n\n\n Once your OpenLDAP and DokuWiki are up and running, login to DokuWiki as a superuser.<\/p>\n\n\n\n DokuWiki by default, ships with an LDAP Authentication Plugin called All you need to do is to activate the plugin. This can be done on the DokuWiki Extensions Manager.<\/p>\n\n\n\n Click Admin tab (with gear icon) at the top of the DokuWiki page and Click Extension Manager<\/strong> on the Administration page that opens up.<\/p>\n\n\n\n On the Extension Manager, Locate LDAP Auth Plugin and beside it, click Once the plugin is activated, you need to define your OpenLDAP connection settings. This can be done from Configuration Manager<\/strong>.<\/p>\n\n\n\n To access Configuration Manager, go back to DokuWiki Administration page and click Configuration Settings<\/strong>.<\/p>\n\n\n\n On the Configuration Manager, navigate to Table of Contents<\/strong> on the sidebar > Plugins<\/strong> > authldap<\/strong>. Define your OpenLDAP configuration settings. Be sure to make appropriate changes as per your environment settings.<\/strong><\/p>\n\n\n\n Define OpenLDAP hostname\/URL, the port, the base DN<\/strong> where to find user accounts, the Bind DN user and password<\/strong> and any other relevant setting.<\/p>\n\n\n\n Once you done with configurations, scroll down the page and click save<\/strong> to update your DokuWiki configuration settings.<\/p>\n\n\n\n The changes made are written to the file, Once the OpenLDAP settings are defined, proceed to define the default authentication method.<\/p>\n\n\n\n Navigate to Table of Contents<\/strong> > DokuWiki<\/strong> > Authentication<\/strong>.<\/p>\n\n\n\n On the Authentication backend, select authldap<\/strong> and save the changes.<\/p>\n\n\n\n What if OpenLDAP connection fails? Hence, it would good to be able to login using the DokuWiki Superuser account. As such, install and enable Chained Auth Plugin which delegates the authentication to the authentication plugin, which first returns true when checking username and password.<\/p>\n\n\n\n Navigate to Extension Manager and search for the plugin and install it.<\/p>\n\n\n\n Once the plugin is installed successfully, you should be able to see a plugin name, chained authentication plugin<\/strong> under Plugins on the Table of contents.<\/p>\n\n\n\n Next, navigate to Configuration Manager and configure the plugin to enable both plain and LDAP authentication including the fall back authentication backend.<\/p>\n\n\n\n Also, change the default authentication backend to authchained<\/strong> plugin.<\/p>\n\n\n\n Once done with making changes, click the Save<\/strong> button to update the configurations.<\/p>\n\n\n\n Now, log out of DokuWiki as superuser and login as a user defined on an OpenLDAP server.<\/p>\n\n\n\n And here you go. OpenLDAP user successfully logged in to DokuWiki.<\/p>\n\n\n\n You can further configure Access controls for the users on your DokuWiki.<\/p>\n\n\n\n Reference:<\/p>\n\n\n\n DokuWiki authldap:openldap<\/a><\/p>\n\n\n\n DokuWiki Chained Auth Plugin<\/a><\/p>\n\n\n\n Configure ownCloud OpenLDAP Authentication<\/a><\/p>\n\n\n\n Configure SSSD for OpenLDAP Authentication on Ubuntu 18.04<\/a><\/p>\n\n\n\nInstall Required PHP LDAP Modules<\/h3>\n\n\n\n
dnf install php-ldap -y<\/code><\/pre>\n\n\n\n
Login to DokuWiki as Superuser<\/h3>\n\n\n\n
Enable DokuWiki LDAP Authentication Plugin<\/h3>\n\n\n\n
authLDAP<\/code><\/strong> that allows authentication against an LDAP directory.<\/p>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
Enable<\/code><\/strong> button to activate the plugin.<\/p>\n\n\n\n
Configure DokuWiki OpenLDAP Authentication Settings<\/h3>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
\/var\/www\/html\/conf\/local.php<\/strong><\/code>.<\/p>\n\n\n\n
less \/var\/www\/html\/conf\/local.php<\/code><\/pre>\n\n\n\n
\n<?php\n\/*\n * Dokuwiki's Main Configuration File - Local Settings\n * Auto-generated by config plugin\n * Run for user: kifarunix\n * Date: Sat, 01 Feb 2020 15:57:53 +0000\n *\/\n\n$conf['title'] = 'Kifarunix-demo';\n$conf['license'] = 'cc-by-sa';\n$conf['useacl'] = 1;\n$conf['authtype'] = 'authchained';\n$conf['superuser'] = '@admin';\n$conf['disableactions'] = 'register';\n$conf['plugin']['authldap']['server'] = 'ldap:\/\/ldapmaster.kifarunix-demo.com';\n$conf['plugin']['authldap']['usertree'] = 'ou=people,dc=ldapmaster,dc=kifarunix-demo,dc=com';\n$conf['plugin']['authldap']['userfilter'] = '(&(uid=%{user})(objectClass=posixAccount))';\n$conf['plugin']['authldap']['version'] = 3;\n$conf['plugin']['authldap']['binddn'] = 'cn=readonly,ou=system,dc=ldapmaster,dc=kifarunix-demo,dc=com';\n$conf['plugin']['authldap']['bindpw'] = '<b>aGFja2Vy';\n$conf['plugin']['authchained']['authtypes'] = 'authplain:authldap';\n\n\/\/ end auto-generated content\n<\/code><\/pre>\n\n\n\n
Define DokuWiki Default Authentication Method<\/h3>\n\n\n\n
Enable DokuWiki Chained Authentication Plugin<\/h3>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/div><\/a><\/div>\n\n\n\n
Testing DokuWiki OpenLDAP Authentication<\/h3>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/div><\/a><\/div>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n