Inhaltsverzeichnis

Single-Sign-On into Moodle using Admidio as an OpenID Provider

Starting with version 5.0, Admidio can be used by other applications to authenticate users against Admidio's 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.

Moodle provides OpenID Connect login through the OpenID Connect (auth_oidc) plugin. In this tutorial, we will describe how to set it up properly for single-sign on using Admido's user accounts.

Prerequisites

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 OpenID Provider (OP). This has to be done once and is not specific to any particular client. Please folow this guide:

Basically, one needs to enable OpenID Connect (OIDC). The Issuer URL should in most cases be left blank, which means Admidio's public URL will be used as issuer URL.

The page https://admidio.local/adm_program/modules/preferences.php?panel=sso also provides the link to the automatic discovery URL, and the individual settings for clients that do not support auto-configuration via metadata.

Quick Overview

Setting up a client (OpenID “Relying Party” = “RP”) to use Admidio's user accounts for log-in consists of two steps:

  1. The client (RP, Moodle in our case) needs to be set up with the data about the OpenID Provider (OP). One has to manually paste the Admidio endpoint URLs of the OpenID provider into the client's configuration. Admidio provides copy buttons in the preferences screen, so this is rather straightforward.
  2. Admidio needs to be told about the client. In particular, the entity ID and the redirect URL must be given, and a custom-generated (random) secret must be copied to the client configuration.

The concrete steps are:

Moodle Login via OpenID using the OpenID Connect user backend (user_oidc)

Configuring the IdP settings for the Relying Party (Moodle)

First, install the OpenID Connect (auth_oidc) app in Moodle from the plugin directory:

Setting up the Client (RP) in Admidio

The next step is to set up Admidio to receive login requests from Moodle. This is done by adding an OpenID client in Admidio.

Return to Admidio's SSO preferences page, go to the “Single-Sign-On Client Administration” (the button right below the endpoint URLs and above the “Save” button), and create a new client.

Now save the Identity Provider Settings in Moodle and return to the general OpenID connect settings of the plugin (https://[YOUR_MOODLE]/admin/category.php?category=oidcfolder).

After saving the changes (both in Moodle and Admidio), the apps should should now be set up for single-sign-on in Moodle.

Fields Mapping

OpenID Connect logins can transfer Profile field information from Admidio to Moodle, but this needs to be set up. In general, OpenID does only include the user identifier, but no other personal information. To allow individual pieces of profile data (a “claim” is one profile field), OpenID groups them into “scopes”, which are groups of profile fields, like “profile”, “address”, “phone”, “groups”, … Each of them allows access to some defined claims. In the Identity Provider Settings the scopes that are requested from Admidio can be configured.

However, Admidio also needs to be configured to map its profile fields to the defined OpenID claims.

Configuring Single-Log-Out

Setup completed, test Single-Sign-On

Admidio and Moodle should now be set up to use Admidio for logging in to Moodle. If you log out of Moodle and try to log in again, you will be shown the Admidio login screen and then redirected back to Moodle after a successful login.

After choosing SAML login and loggin in with a user from Admidio, you should be logged in to Moodle.

Caveats and Things to Consider