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 Moodle to Admidio to use Admidio's login. For general instructions, and other apps, please visit the general Single-Sign-On overview page.
There are several SAML plugins for Moodle. We will describe SAML login via the “SAML2 Single sign on” plugin. Unfortunately, that app does not (yet) use rule mapping (i.e. using Admidio groups to grant permission in Moodle).
There is also the SAML2 SSO Auth plugin, which depends on an separate installation of simpleSAMLphp. If you prefer this pugin, follow the instructions to set up SimpleSAMLphp with Admidio. Once SimpleSAMLphp is working, connecting the Moodle installation to SimpleSAMLphp using the SAML2 SSO Auth is rather straightforward.
Throughout the document we will assume you have both Admidio and Moodle already set up properly at https://admidio.local/ and https://moodle.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 any client. Please follow this guide: #a_basic_setup_for_admidio_as_a_saml_id_provider
Basically, one (1) needs to create a cryptographic key to sign message and choose a unique EntityID. The page preferences https://admidio.local/modules/preferences.php?panel=sso also 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” - short SP) to use Admidio's user accounts for logging in consists of two steps. If both the IdP (Admidio in our case) and the SP (Moodle 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 situation is not as bad, either.
https://[YOUR_MOODLE]/auth/saml2/sp/metadata.php
. This URL will lalter be inserted into Admidio's configuration.Once these basic SAML settings are done, I would recommend saving the plugin configuration and to set up the SP in Admidio. The remaining settings (transmitted fields, as well as signing/encryption requirements) are best done in parallel in Moodle 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.
Paste the metadata URL copied from Moodle into the corresponding input field at the top and click “Load Client Metadata”. This should load all settings from Moodle 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, but it will be displayed to the end user in the login form.
A seemingly large part of the plugin configuration is dedicated to mapping Admidio's (IdP) fields to profile data fields in Moodle. The first, important mapping is the field for the username. Make sure to map the Admidio username to a SAML field and use it in Moodle to map to the user ID.
Towards the end of the configuration screen, a whole section “Data mapping” is dedicated to fields mapping. Each profile field has four settings: “Data mapping” (SAML attribute from Admidio), “Update local”, “Update external” and “Lock value”. None of these values is required, but if they are mapped, Admidio's profile data is properly imported into Moodle's profile.
The last section would allow Moodle to act as a SAML IdP, which is not relevant in our case. Enabling IDP means that Moodle's user accounts can be used by other applications. This, however, is not our scope in this tutorial.
Admidio and Moodle should now be set up to use Admidio for logging in to Moodle. The SAML plugin even provides a way to test the plugin configuration: Return to Moodle's plugin list (see above), which shows a “Test settings” next to the “Settings” link for the plugin:
The test settings page allows a test login from Moodle to Admidio without influencing the current session Moodle. If login is successful, the profile data provided by Admidio is displayed.
Once, this dry run is successful, one can attempt a real login through SAML.
If you log out of Moodle (or open Moodle in an incognito browser window) and go to the Moodle admin location, you should see the login screen with the choice of logging in with password or via SAML.
After choosing SAML login and loggin in with a user from Admidio, you should be logged in to Moodle.