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 Matomo to Admidio to use Admidio's login. For general instructions, and other apps, please visit the general Single-Sign-On overview page.
Matomo provides OpenID Connect login through the Login OIDC or its fork RebelOIDC plugins. Both plugins are free and work similarly. RebelOIDC is a relatively recent fork to fix some long-standing issues in LoginOIDC. On the other hand, LoginOIDC has a longer history and a larger user base. Both of them are good choices, and the configuration is similar. The only difference so far is that in the redirect URL for RebelOIDC the string LoginOIDC must be replaced with RebelOIDC.
Throughout the document we will assume you have both Admidio and Matomo already set up properly at https://admidio.local/ and https://matomo.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.
Setting up Matomo (OpenID “Relying Party” = “RP”) to use Admidio's user accounts for log-in consists of two steps:
The concrete steps are:
https://[YOUR_MATOMO_URL]/index.php?module=LoginOIDC&action=callback&provider=oidc).sub, which is the standard field in OpenID to hold the unique user ID.profile and email are recommended so that Matomo receives the username and email fields from Admidio.https://[YOUR_MATOMO_URL]/index.php?module=LoginOIDC&action=callback&provider=oidc (or for the RebelOIDC plugin: https://[YOUR_MATOMO_URL]/index.php?module=RebelOIDC&action=callback&provider=oidc). Enter this URL in Admidio.After saving the changes (both in Matomo and Admidio), the apps should should now be set up for single-sign-on in Matomo.
Admidio and Matomo should now be set up to use Admidio for logging in to Matomo. If you log out of Matomo and try to log in again, you will be shown the Admidio login screen and then redirected back to Matomo after a successful login.
If a new user logs in, a new user account is created (if the corresponding config setting is selected), but the new user will not have any permissions and an error will be displayed.
A Matomo admin must assign the correct permissions to the new user. This can be done in the Matomo user config section. Superuser permissions cannot be assigned in the list, but one can open the user for editing with the icon on the right:
Once the user has access permissions to a page, the successfull login will show the analytics page of Matomo: