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 Nextcloud to Admidio to use Admidio's login. For general instructions, and other apps, please visit the general Single-Sign-On overview page.
Nextcloud provides several apps that offer OpenID Connect login to Nextcloud:
App | Homepage | Comments |
---|---|---|
OpenID Connect user backend (user_oidc) | Appstore, Homepage/Sourcecode | Official OIDC app, supportsauto-discovery, supports groups, supports field mapping, supports auto-creation of user accounts on login. |
OpenID Connect Login (oidc_login) | Appstore, Homepage/Sorucecode | Forked off sociallogin, configuration only via config file, no UI. Supports auto-discovery, supports groups, supports field mapping, supports auto-creation of user accounts on login. |
Social Login (sociallogin) | Appstore, Homepage/Sourcecode | Targeted at providing login through social apps, allows generic OpenID Connect or OAuth login. No Auto-discovery. Supports groups. Creates its own usernames and groups, does not support accounts that were created locally or through other backends! |
Throughout the document we will assume you have both Admidio and Nextcloud already set up properly at https://admidio.local/ and https://nextcloud.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 Nextcloud. 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, Nextcloud in our case) needs to be set up with the data about the OpenID Provider (OP). IF the plugin supports auto-discovery, paste the .well-known/openid-configuration URL from Admidio into the plugin config. Otherweise, 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:
The most convenient OpenID Connect support for Nextcloud is provided by the “**OpenID Connect user backend** (user_oidc)” plugin. It supports multiple OpenID Providers, support for groups, fields mapping, automatic user-creation on login and auto-discovery of settings. Its configuration is done in Nextcloud's preferencess UI.
First, install the OpenID Connect user backend app in Nextcloud:
After installation it can be configured by an administrator in Nextcloud's preferences in the menu item “Administration” → “OpenID Connect”.
https://[YOUR_ADMIDIO]/modules/sso/index.php/oidc/.well-known/openid-configuration
). It should be pasted into Nextcloud's OpenID Client configuration as “Discovery endpoint”. All other endpoints shown in Admidio's preferences screen are provided in the discovery document and don't need to be copied manually.It is now a good idea to keep two browser windows open with Admidio and Nextcloud's configuration 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 Nextcloud 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.
After saving the changes (both in Nextcloud and Admidio), the apps should should now be set up for single-sign-on in Nextcloud.
The “**OpenID Connect Login**” plugin for Nextcloud provides OpenID login with support for groups, field mapping, automatic user-creation on login and auto-discovery of settings. Its configuration is done entirely in Nextcloud's config/config.php
file, there is no graphical user interface.
config/config.php
in a text editor and insert the following configuration options into the array at the end of the file:<?php $CONFIG = array ( [...] // Configuration for nextcloud-oidc-login // Source/Documentation: https://github.com/pulsejet/nextcloud-oidc-login // Configuration is done in the config.php file ONLY 'allow_user_to_change_display_name' => false, 'lost_password_link' => 'disabled', // URL of provider. All other URLs are auto-discovered from .well-known 'oidc_login_provider_url' => 'https://admidio.local/modules/sso/index.php/oidc', 'oidc_login_button_text' => 'OpenID with Admidio (login_oidc)', 'oidc_login_client_id' => 'https://nextcloud.local/login_oidc', 'oidc_login_client_secret' => 'eZ9QTb7BIcGLUrKadeMQel8/dZyPiqNS', 'oidc_login_logout_url' => 'https://nextcloud.local/', 'oidc_login_end_session_redirect' => true, 'oidc_login_hide_password_form' => false, 'oidc_login_use_id_token' => false, 'oidc_login_attributes' => array ( 'id' => 'sub', 'name' => 'fullname', 'mail' => 'email', 'groups' => 'groups', 'is_admin' => 'groups_admin', ), 'oidc_login_scope' => 'openid profile email address phone groups custom', 'oidc_login_disable_registration' => false, // 'oidc_login_redir_fallback' => true, 'oidc_login_tls_verify' => true, 'oidc_create_groups' => true, 'oidc_login_webdav_enabled' => true, 'oidc_login_password_authentication' => true, 'oidc_login_public_key_caching_time' => 86400, 'oidc_login_min_time_between_jwks_requests' => 10, 'oidc_login_well_known_caching_time' => 86400, 'oidc_login_code_challenge_method' => 'S256', );
The plugin supports some more settings (as described on its homepage), which you can insert as needed.
config/config.php
file, 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 Nextcloud configuration.\'oidc_login_provider_url\
':'oidc_login_provider_url' => 'https://admidio.local/modules/sso/index.php/oidc',
https://[YOUR_NEXTCLOUD]/apps/oidc_login/oidc
That's it, login via OpenID Connect should now be possible with Admidio's user accounts.
Nextcloud's **Social Login** plugin is distributed together with Nextcloud with the purpose of allowing login to Nextcloud using user accounts from social networks like Google, Facebook, Twitter, GitHub, etc. However, most of these use the OpenID Connect standard (or the OAuth 2.0 standard, on which OpenID is based), so it also allows generic OpenID providers to be used as login backend for Nextcloud.
One drawback of the sociallogin plugin compared to the user_oidc and oidc_login plugins described above is that the sociallogin plugin does not reuse existing user accounts and groups, but always creates custom accounts with the prefix configured for the account. This means that it is not possible for a local account to connect an OpenID account to log in to the existing account. Other plugins also use that approach for security reasons, but they allow turning off that behavior.
It is now a good idea to keep two browser windows open with Admidio and Nextcloud's configuration 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 Nextcloud 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.
https://[YOUR_NEXTCLOUD]/apps/sociallogin/custom_oidc/[INTERNAL_NAME]
.After saving the changes (both in Nextcloud and Admidio), the apps should should now be set up for single-sign-on in Nextcloud.
Admidio and Nextcloud should now be set up to use Admidio for logging in to Nextcloud. If you log out of Nextcloud and try to log in again, you will be shown the Admidio login screen and then redirected back to Nextcloud. The login buttons for each of the three possible OpenID plugins look very similar and work similar.
After successful login to Admidio, the user will be redirected back to Nextcloud and logged in.
Even though login looks idential for all three, internally, there are difference in how the login is registered.