{"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<p>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<h2 class=\"wp-block-heading\">Configuring DokuWiki for OpenLDAP Authentication<\/h2>\n\n\n\n<p>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<p><a href=\"https:\/\/kifarunix.com\/install-and-setup-openldap-on-centos-8\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Install and Setup OpenLDAP on CentOS 8<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-dokuwiki-on-centos-8\/\" target=\"_blank\">Install DokuWiki on CentOS 8<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Install Required PHP LDAP Modules<\/h3>\n\n\n\n<p>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<pre class=\"wp-block-preformatted\"><code>dnf install php-ldap -y<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Login to DokuWiki as Superuser<\/h3>\n\n\n\n<p>Once your OpenLDAP and DokuWiki are up and running, login to DokuWiki as a superuser.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enable DokuWiki LDAP Authentication Plugin<\/h3>\n\n\n\n<p>DokuWiki by default, ships with an LDAP Authentication Plugin called <strong><code>authLDAP<\/code><\/strong> that allows authentication against an LDAP directory.<\/p>\n\n\n\n<p>All you need to do is to activate the plugin. This can be done on the DokuWiki Extensions Manager.<\/p>\n\n\n\n<p>Click Admin tab (with gear icon) at the top of the DokuWiki page and Click <strong>Extension Manager<\/strong> on the Administration page that opens up.<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/administration.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1026\" height=\"626\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/administration.png\" alt=\"How to Configure DokuWiki OpenLDAP Authentication\" class=\"wp-image-11990\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/administration.png?v=1648578142 1026w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/administration-768x469.png?v=1648578142 768w\" sizes=\"(max-width: 1026px) 100vw, 1026px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>On the Extension Manager, Locate LDAP Auth Plugin and beside it, click <strong><code>Enable<\/code><\/strong> button to activate the plugin.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configure DokuWiki OpenLDAP Authentication Settings<\/h3>\n\n\n\n<p>Once the plugin is activated, you need to define your OpenLDAP connection settings. This can be done from <strong>Configuration Manager<\/strong>.<\/p>\n\n\n\n<p>To access Configuration Manager, go back to DokuWiki Administration page and click <strong>Configuration Settings<\/strong>.<\/p>\n\n\n\n<p>On the Configuration Manager, navigate to <strong>Table of Contents<\/strong> on the sidebar &gt; <strong>Plugins<\/strong> &gt; <strong>authldap<\/strong>. Define your OpenLDAP configuration settings. <strong>Be sure to make appropriate changes as per your environment settings.<\/strong><\/p>\n\n\n\n<p>Define <strong>OpenLDAP hostname\/URL, the port, the base DN<\/strong> where to find user accounts, t<strong>he Bind DN user and password<\/strong> and any other relevant setting.<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/plugin-configs.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"839\" height=\"654\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/plugin-configs.png\" alt=\"How to Configure DokuWiki OpenLDAP Authentication\" class=\"wp-image-11991\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/plugin-configs.png?v=1648578168 839w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/plugin-configs-768x599.png?v=1648578168 768w\" sizes=\"(max-width: 839px) 100vw, 839px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>Once you done with configurations, scroll down the page and click <strong>save<\/strong> to update your DokuWiki configuration settings.<\/p>\n\n\n\n<p>The changes made are written to the file, <code><strong>\/var\/www\/html\/conf\/local.php<\/strong><\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>less \/var\/www\/html\/conf\/local.php<\/code><\/pre>\n\n\n\n<pre class=scroll-box>\n&lt;?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'] = '(&amp;(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'] = '&lt;b>aGFja2Vy';\n$conf['plugin']['authchained']['authtypes'] = 'authplain:authldap';\n\n\/\/ end auto-generated content\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Define DokuWiki Default Authentication Method<\/h3>\n\n\n\n<p>Once the OpenLDAP settings are defined, proceed to define the default authentication method.<\/p>\n\n\n\n<p>Navigate to <strong>Table of Contents<\/strong> &gt; <strong>DokuWiki<\/strong> &gt; <strong>Authentication<\/strong>.<\/p>\n\n\n\n<p>On the Authentication backend, select <strong>authldap<\/strong> and save the changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enable DokuWiki Chained Authentication Plugin<\/h3>\n\n\n\n<p>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<p>Navigate to Extension Manager and search for the plugin and install it.<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/install-authchained.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"877\" height=\"304\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/install-authchained.png\" alt=\"How to Configure DokuWiki OpenLDAP Authentication\" class=\"wp-image-11992\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/install-authchained.png?v=1648578202 877w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/install-authchained-768x266.png?v=1648578202 768w\" sizes=\"(max-width: 877px) 100vw, 877px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>Once the plugin is installed successfully, you should be able to see a plugin name, <strong>chained authentication plugin<\/strong> under Plugins on the Table of contents.<\/p>\n\n\n\n<p>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<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/authchained-plain.png\" class=\"td-modal-image\"><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"831\" height=\"243\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/authchained-plain.png\" alt=\"How to Configure DokuWiki OpenLDAP Authentication\" class=\"wp-image-11993\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/authchained-plain.png?v=1648578224 831w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/authchained-plain-768x225.png?v=1648578224 768w\" sizes=\"(max-width: 831px) 100vw, 831px\" \/><\/figure><\/div><\/a><\/div>\n\n\n\n<p>Also, change the default authentication backend to <strong>authchained<\/strong> plugin.<\/p>\n\n\n\n<p> Once done with making changes, click the <strong>Save<\/strong> button to update the configurations.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Testing DokuWiki OpenLDAP Authentication<\/h3>\n\n\n\n<p>Now, log out of DokuWiki as superuser and login as a user defined on an OpenLDAP server.<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/dokuwiki-ldapuser-login.png\" class=\"td-modal-image\"><figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"920\" height=\"539\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/dokuwiki-ldapuser-login.png\" alt=\"How to Configure DokuWiki OpenLDAP Authentication\" class=\"wp-image-11994\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/dokuwiki-ldapuser-login.png?v=1648578250 920w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/dokuwiki-ldapuser-login-768x450.png?v=1648578250 768w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/figure><\/a><\/div>\n\n\n\n<p>And here you go. OpenLDAP user successfully logged in to DokuWiki.<\/p>\n\n\n\n<div><a href=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/logged-in-ldap.png\" class=\"td-modal-image\"><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"819\" height=\"409\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/logged-in-ldap.png\" alt=\"\" class=\"wp-image-11995\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/logged-in-ldap.png?v=1648578267 819w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/logged-in-ldap-768x384.png?v=1648578267 768w\" sizes=\"(max-width: 819px) 100vw, 819px\" \/><\/figure><\/div><\/a><\/div>\n\n\n\n<p>You can further configure Access controls for the users on your DokuWiki.<\/p>\n\n\n\n<p>Reference:<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\"DokuWiki authldap:openldap (opens in a new tab)\" href=\"https:\/\/www.dokuwiki.org\/plugin:authldap:openldap\" target=\"_blank\">DokuWiki authldap:openldap<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\"DokuWiki Chained Auth Plugin (opens in a new tab)\" href=\"https:\/\/www.dokuwiki.org\/plugin:authchained\" target=\"_blank\">DokuWiki Chained Auth Plugin<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Other Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/configure-owncloud-openldap-authentication\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Configure ownCloud OpenLDAP Authentication<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/configure-sssd-for-openldap-authentication-on-ubuntu-18-04\/\" target=\"_blank\">Configure SSSD for OpenLDAP Authentication on Ubuntu 18.04<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-phpldapadmin-on-centos-8\/\" target=\"_blank\">Install phpLDAPadmin on CentOS 8<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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<\/p>\n","protected":false},"author":1,"featured_media":11996,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,285,1099],"tags":[4776,1276,1279,1280],"class_list":["post-4987","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-directory-server","category-openldap","tag-configure-openldap-dokuwiki-authentication","tag-dokuwiki","tag-dokuwiki-openldap","tag-openldap-authentication","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4987"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=4987"}],"version-history":[{"count":5,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4987\/revisions"}],"predecessor-version":[{"id":21332,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/4987\/revisions\/21332"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/11996"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=4987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=4987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=4987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}