Starting with version 5.0, Admidio can be used by other applications to authenticate users against Admidios user base. These instructions will guide you through the process of connecting DokuWiki to Admidio to use Admidio's login. For general instructions, and other apps, please visit the general Single-Sign-On overview page.
Throughout the document we will assume you have both Admidio and DokuWiki already set up properly at https://admidio.local/ and https://dokuwiki.local/. Please modify these URLs to your actual installation.
As a first step, one needs to configure Admidio to act as an SAML 2.0 Identity Provider (IdP). This has to be done once and is not specific to DokuWiki. Please follow this guide.
Basically, one needs to enable SAML 2.0 and choose a unique EntityID.
The page https://admidio.local/adm_program/modules/preferences.php?panel=sso provides the link to the metadata xml, and the individual settings in case a client does not support auto-configuration via metadata.
Setting up a client (SAML “Service Provider” = “SP”) to use Admidio's user accounts for log-in consists of two steps. If both the IdP (Admidio in our case) and the SP (Dokuwiki in this document) support metadata loading, the setup is very straightforward and easy. Otherwise, one has to copy URLs manually to the client, but Admidio already provides these in a single place, so this case is also straightforward.
SAML 2.0 login in DokuWiki is provided by the “SAML Plugin” extension.
After installation it can be configured in DokuWiki's Configuration Settings, near the bottom in the “Saml” section. The extension would also provide a configuration helper, but the information can also be copied over from Admidio's preferences directly.
It is a good idea to keep two browser windows open so one can easily select and copy the settings. Admidio even provides little “copy” buttons/icons to copy the various settings to the clipboard for easy pasting into DokuWiki's configuration.
This is a typical configuration of the DokuWiki SAML extension for Admidio as an idP:
Once these basic SAML settings are done, it's best to start setting up the client in Admidio, and do the remaining settings (transmitted fields and roles, as well as signing/encryption requirements) in parallel in Dokuwiki and Admidio.
Now, return to Admidio's SSO preferences page, go to the “Single-Sign-On Client Administration” (the button right above the “Save” button), and create a new client.
DokuWiki provides its SAML SP client settings as a metadata XML. Unfortunately, there is no direct link to copy the URL from, but the URL is easy to construct:
https://[URL_TO_YOUR_DOKUWIKI]/doku.php?do=saml
Paste that metadata URL into the corresponding input field at the top and click “Load Client Metadata”. This should load all settings from Dokuwiki and pre-fill the following fields correctly. Only the Client Name needs to be entered. Choose any name to clearly identify the client in the list of SAML clients. There is no functionality depending on the name.
In addition to the Entity ID and URLs to connect SP and IdP and the certificate, which are configured automatically, one also needs to define the attribute and role mapping. Both Admidio and Dokuwiki allow configuring the attribute used as login name and groups, so the actual attribute name is not important, but Dokuwiki and Admidio must be configured to use the same name (circled in the image). To use Admidio's group memberships as Dokuwiki groups, make sure to include the “Roles” profile field and map the included groups to SAML (=Dokuwiki) roles.
Dokuwiki does not support signing its messages to admidio, so the corresponding settings in Admidio are not applicable.
Once all settings are done, it is time to enable the saml plugin for login to DokuWiki in the “Configuration Settings”:
The settings done above in the graphical interface could also be done in the conf/local.php config file of DokuWiki. The corresponding settings would look like this:
$conf['authtype'] = 'saml'; $conf['superuser'] = '@admin'; $conf['plugin']['saml']['idPEntityID'] = 'https://admidio.local'; $conf['plugin']['saml']['endpoint'] = 'https://admidio.local/modules/sso/index.php/saml/sso'; $conf['plugin']['saml']['slo_endpoint'] = 'https://admidio.local/modules/sso/index.php/saml/slo'; $conf['plugin']['saml']['certificate'] = '-----BEGIN CERTIFICATE----- MIID4DCCAsigAwIBAgIBADANBg...nS+ViEoHuI2FSMyLpVB5 -----END CERTIFICATE-----'; $conf['plugin']['saml']['use_slo'] = 1;
Admidio and DokuWiki should now be set up to use Admidio for logging in to Dokuwiki. If you log out of DokuWiki and try to log in again, you will be shown the Admidio login screen and then redirected back to Dokuwiki.