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 WordPress 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 WordPress already set up properly at https://admidio.local/ and https://wordpress.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 WordPress. Please follow this guide: #a_basic_setup_for_admidio_as_an_oidc_id_provider
Basically, one (1) needs to create a cryptographic key to sign message and choose a unique EntityID. The page https://admidio.local/adm_program/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 (OpenID “Relying Party” - short RP) to use Admidio's user accounts for logging in consists of two steps: (1) The client (RP, WordPress in our case) needs to be set up with the data about the OpenID Provider (OP). As WordPress does not support auto-configuration useing the OpenID discovery endpoint, one has to manually paste the endpoint URLs of the OpenID provider. 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:
There are several OpenID plugins for WordPress, but none of the free versions supports permission mapping based on groups. The best free plugin we found is the OpenID Connect for WP plugin, which is a hard fork of Jonathan Daggerhart's OpenID Connect Generic plugin (which he is no longer able to maintain due to WordPress's stance on WP Engine and the fallout of the actions of Matt Mullenweg). The “OpenID Connect for WP” plugin is not available in the Wordpress plugin directory, only the previous “OpenID Connect Generic” by Daggerhart. We still recommend to use the newer “OpenID Connect for WP” and install it manually (either using git or by downloading the plugin code to the WP installation). See the plugin's source code repository on GitHub: https://github.com/forumone/openid-connect-wp-dist
If you have shell access to the WP installation, the easiest way is to use the git shell command:
# Switch to the base directory of your WordPress installation. Then: cd wp-content/plugins/ git clone https://github.com/forumone/openid-connect-wp-dist.git
After installation it can be configured in the menu item “Settings” → “OpenID Connect Client”.
First, one has to copy over the OpenID endpoint URLs from Admidio's OpenID preferences (each URL has a copy button). You can find them here:
The remaining settings in Wordpress are client-specific, so one first needs to setup the OpenID client in Admidio and configure WordPress and Admidio in parallel.
It is now 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 the WordPress configuration.
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.
In addition, WordPress also provides settings to map OpenID claims (defined profile fields with a fixed name, defined in the OpenID standard) to the WordPress user's ID, nickname, email and fullname, as well as flags to enable automatic user creation when a new user logs in to WordPress.
After saving the changes (both in WordPress and Admidio), the apps should should now be set up for single-sign-on in WordPress.
Admidio and WordPress should now be set up to use Admidio for logging in to WordPress. If you log out of WordPress and try to log in again, you will be shown the Admidio login screen and then redirected back to WordPress.