Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:2.0:single_sign_on [2025/05/03 15:32] – kainhofer | en:2.0:single_sign_on [2025/05/05 01:25] (current) – [C. Configuring Admidio with the Service Provider] kainhofer | ||
---|---|---|---|
Line 3: | Line 3: | ||
Starting with version 5.0, Admidio can be used by other applications to authenticate users against Admidios user base via Single-Sign-On (SSO). When initiating a login to the application, | Starting with version 5.0, Admidio can be used by other applications to authenticate users against Admidios user base via Single-Sign-On (SSO). When initiating a login to the application, | ||
- | The two dominant protocols | + | The two dominant protocols |
- | <WRAP centeralign> | ||
- | [[en: | ||
- | [[en: | + | ^ Client |
- | + | ^ {{: | |
- | [[en: | + | ^ {{: |
- | |{{: | + | ^ {{: |
- | </ | + | ^ {{: |
+ | ^ {{: | ||
+ | ^ {{: | ||
+ | ^ {{: | ||
+ | ^ {{: | ||
+ | ^ {{: | ||
+ | ^ {{: | ||
+ | | | ||
Other systems like Prestashop do not provide any freely available SAML plugin, only some very expensive commercial extensions. | Other systems like Prestashop do not provide any freely available SAML plugin, only some very expensive commercial extensions. | ||
Line 22: | Line 27: | ||
To set up a third-party web application to use single-sign-on through Admidio as a SAML 2.0 Identity Provider (so that other applications will use Admidio' | To set up a third-party web application to use single-sign-on through Admidio as a SAML 2.0 Identity Provider (so that other applications will use Admidio' | ||
- | - [[# | + | - [[# |
- Create a cryptographic key for signing/ | - Create a cryptographic key for signing/ | ||
- | - Choose a unique entityID | + | - Choose a unique entityID |
- | - [[# | + | - [[# |
- In the simplest case, paste the metadata URL into the client configuration | - In the simplest case, paste the metadata URL into the client configuration | ||
- If the client does not support auto-setup using metadata, manually copy/enter the settings: | - If the client does not support auto-setup using metadata, manually copy/enter the settings: | ||
- Admidio URLs for Single-sign-on (SSO) and Single-Log-Out (SLO) | - Admidio URLs for Single-sign-on (SSO) and Single-Log-Out (SLO) | ||
- Public key / certificate of the Admidio IdP. | - Public key / certificate of the Admidio IdP. | ||
- | - Choose a unique | + | - Choose a unique |
- | - [[# | + | - [[# |
- Create a new SAML client in Admidio' | - Create a new SAML client in Admidio' | ||
- Ideally, the client (" | - Ideally, the client (" | ||
- | - If not, manually copy/enter the Client ID, theURL | + | - If not, manually copy/enter the Client ID, the URL where the user should be redirected after login (ACS URL) as well as an optional cryptographic certificate used by the client to sign messages. |
- In many cases, the automatic setup via metadata will work, but it is possible to add further configuration, | - In many cases, the automatic setup via metadata will work, but it is possible to add further configuration, | ||
This page will describe the generic setup of a Admidio and a SAML 2.0 client. It has been tested with several SAML-ready applications, | This page will describe the generic setup of a Admidio and a SAML 2.0 client. It has been tested with several SAML-ready applications, | ||
- | |||
===== Setup overview for OpenID Connect ===== | ===== Setup overview for OpenID Connect ===== | ||
- | To set up a third-party web application to use single-sign-on through Admidio as an OpenID Connect Identity Provider (so that other applications will use Admidio' | + | To set up a third-party web application |
- | - [[#a_basic_setup_for_admidio_as_a_oidc_id_provider|General Setup of the OIDC IdP in Admidio]]: | + | - [[#a_basic_setup_for_admidio_as_an_openid_connect_id_provider|General Setup of the OIDC IdP in Admidio]]: |
- Create a cryptographic key for signing/ | - Create a cryptographic key for signing/ | ||
- | - Choose a unique entityID | + | - Choose a unique entityID |
- | - [[#b_configuring_an_app_service_provider_to_use_sso_with_admidio|Configuration of the client app (Service Provider)]]: Admidio will provide a link with all required metadata for clients to use (https:// | + | - [[#b_configuring_an_app_relying_party_to_use_sso_with_admidio|Configuration of the client app (Relying Party)]]: Admidio will provide a link with all required metadata for clients to use (https:// |
- In the simplest case, paste the metadata URL into the client configuration | - In the simplest case, paste the metadata URL into the client configuration | ||
- If the client does not support auto-setup using metadata, manually copy/enter the settings: | - If the client does not support auto-setup using metadata, manually copy/enter the settings: | ||
- | - Admidio URLs for Single-sign-on | + | - Admidio URLs (endpoints) for authorization, |
- Public key / certificate of the Admidio IdP. | - Public key / certificate of the Admidio IdP. | ||
- | - Choose a unique | + | - Choose a unique |
- | - [[#c_configuring_admidio_with_the_service_provider|Set up Admidio respond to request from that particular client]]: | + | - Select the scopes (classes of information) that Admidio should send to the client (e.g. " |
- | - Create a new SAML client in Admidio' | + | - Optionally a mapping of the OpenID claims (individual data fields) to the client' |
- | - Ideally, | + | - [[#c_configuring_admidio_with_the_relying_party|Set up Admidio |
- | - If not, manually copy/enter the Client | + | - Create a new OIDC client in Admidio' |
- | - In many cases, the automatic | + | - Paste the "Client ID" |
+ | - Admidio will show a "Client | ||
+ | - Select which scopes | ||
+ | - OpenID does NOT provide any automatic | ||
- | This page will describe the generic setup of a Admidio and a SAML 2.0 client. It has been tested with several | + | |
+ | This page will describe the generic setup of a Admidio and an OpenID | ||
- | ^ Client | ||
- | ^ Nextcloud | ||
- | ^ DokuWiki | ||
- | ^ Wordpress | ||
- | | Joomla | ||
- | | Drupal | ||
- | | Moodle | ||
- | | MediaWiki | ||
- | | Odoo | | | | ||
- | | Gitlab | ||
- | | Keycloak | ||
Line 86: | Line 83: | ||
Step 2 are done by the application in this case, but there is no technical requirement for this. In principle, the decision that a user has successfully logged in can be done by any **trusted** system. This is where single-sign-on hooks in: Rather than each app requesting and processing passwords, step 2 is delegated to a so-called identity provider (" | Step 2 are done by the application in this case, but there is no technical requirement for this. In principle, the decision that a user has successfully logged in can be done by any **trusted** system. This is where single-sign-on hooks in: Rather than each app requesting and processing passwords, step 2 is delegated to a so-called identity provider (" | ||
- | ==== Single-Sign-On using an external Identity Provider (IdP) ==== | + | ==== Single-Sign-On |
There are two established technical protocols for Single-Sign-On: | There are two established technical protocols for Single-Sign-On: | ||
+ | |||
+ | SAML 2.0 is based on XML messages, and basically just outsources the login form and the resulting login success decision to the IdP. If login is successful, the IdP sends this information (together with the user name and optionally some further profile fields) as a cryptographically signed XML to the SAML client. | ||
In the SAML case, the login flow above changes to the following. But but from a user perspective, | In the SAML case, the login flow above changes to the following. But but from a user perspective, | ||
Line 107: | Line 106: | ||
- It is extremely important to ensure that the requests are really sent to the right system and the returned responses really originate from the authorized IdP. This can be assured by using **public key cryptography**, | - It is extremely important to ensure that the requests are really sent to the right system and the returned responses really originate from the authorized IdP. This can be assured by using **public key cryptography**, | ||
- The **IdP and the SP never communicate directly**, only through the user's browser! As a consequence, | - The **IdP and the SP never communicate directly**, only through the user's browser! As a consequence, | ||
+ | |||
+ | ==== Single-Sign-On with OpenID Connect using an external Identity Provider (IdP) ==== | ||
+ | |||
+ | OpenID Connect is based on exchanging data with JSON objects. Rather than working only with browser redirects like SAML, OpenID is based on OAuth and extensively uses direct communication (" | ||
+ | |||
+ | |||
+ | <WRAP center round todo 60%> | ||
+ | todo box | ||
+ | </ | ||
Line 140: | Line 148: | ||
Each SP first needs to be set up with the URLs (and keys) to connect to Admidio. This can ideally be done by providing the SP with the link to the metadata. After that, Admidio needs to be configured to accept login requests from the SP. Again, each SP typically provides the required data as a metadata XML, which can be loaded in Admidio to set up the client for Single-sign-on functionality. The details depend on the actual client app. | Each SP first needs to be set up with the URLs (and keys) to connect to Admidio. This can ideally be done by providing the SP with the link to the metadata. After that, Admidio needs to be configured to accept login requests from the SP. Again, each SP typically provides the required data as a metadata XML, which can be loaded in Admidio to set up the client for Single-sign-on functionality. The details depend on the actual client app. | ||
- | |||
- | Here we show the setup at the examples of: | ||
- | * [[# | ||
- | * [[# | ||
- | * [[# | ||
Line 151: | Line 154: | ||
Once Admidio is set up to act as a SAML 2.0 IdP, the clients (Service Providers, " | Once Admidio is set up to act as a SAML 2.0 IdP, the clients (Service Providers, " | ||
- | * **Metadata URL** (optional; for automatic setup of clients): https:// | + | * **Metadata URL** (optional; for automatic setup of clients): https:// |
* If your SP supports entering and loading the metadata XML, make sure to use it. It will load the correct settings from the SAML IdP and set up most settings correctly! | * If your SP supports entering and loading the metadata XML, make sure to use it. It will load the correct settings from the SAML IdP and set up most settings correctly! | ||
* **IdP SAML Entity ID** (unique identifier of the Admidio instance): https:// | * **IdP SAML Entity ID** (unique identifier of the Admidio instance): https:// | ||
- | * **SSO Endpoint** (where the SP sends the login request): https:// | + | * **SSO Endpoint** (where the SP sends the login request): https:// |
- | * **SLO Endpoint** (where logout requests are sent to): https:// | + | * **SLO Endpoint** (where logout requests are sent to): https:// |
* **x509 Certificate** (to allow clients to verify the cryptographic signatures): | * **x509 Certificate** (to allow clients to verify the cryptographic signatures): | ||
Line 163: | Line 166: | ||
Also, some clients offer a setting that SAML login is only possible for users that are already manually created in the SP, while others offer a setting to automatically create user accounts on successful SAML login. | Also, some clients offer a setting that SAML login is only possible for users that are already manually created in the SP, while others offer a setting to automatically create user accounts on successful SAML login. | ||
- | The details always depend on the particular client. | + | The details always depend on the particular client. |
+ | |||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | |||
===== C. Configuring Admidio with the Service Provider ===== | ===== C. Configuring Admidio with the Service Provider ===== | ||
- | Once the client is set up to send authentication requests to Admidio, Admidio needs to be configured to respond to them. All SAML clients (Service Providers) are configured in the SSO Client Administration page, which can be reached from the SSO Preferences page (https:// | + | Once the client is set up to send authentication requests to Admidio, Admidio needs to be configured to respond to them. All SAML clients (Service Providers) are configured in the SSO Client Administration page, which can be reached from the SSO Preferences page (https:// |
{{ : | {{ : | ||
Line 172: | Line 188: | ||
To ensure only legitimate login requests from the real client are processed, Admidio needs the entity ID, the URL for redirect as well as the x509 certificate (if messages are cryptographically signed). The following settings are needed for setup. They MUST be consistent with the settings configured in the SAML client (SP). Many SPs provide a Metadata XML link or file with all required settings included for automatic client setup. In Admidio' | To ensure only legitimate login requests from the real client are processed, Admidio needs the entity ID, the URL for redirect as well as the x509 certificate (if messages are cryptographically signed). The following settings are needed for setup. They MUST be consistent with the settings configured in the SAML client (SP). Many SPs provide a Metadata XML link or file with all required settings included for automatic client setup. In Admidio' | ||
- | * **Metadata URL** (for automatic setup of clients): | + | * **Metadata URL** (for automatic setup of clients): |
- | * If your SP supports entering and loading the metadata | + | * If your SP provides a metadata |
- | * **IdP SAML Entity | + | * **Client |
- | * **SSO Endpoint** (where | + | * **ACS URL** (where |
- | * **SLO Endpoint** (where logout requests are sent to): https:// | + | * **Single-Log-Out URL** (optional): Backchannel endpoint to log out from all clients |
- | * **x509 Certificate** (to allow clients to verify | + | * **x509 Certificate** (to allow verification of the messages sent by the SP): PEM-format needs to be copied out from the client |
- | * **User ID**: Whether the client gets the numeric Admidio user id, the globally unique UUID, or the user's login name as user ID | + | * **User ID field**: Whether the client gets the numeric Admidio user id, the globally unique UUID, or the user's login name as user ID |
* Further **profile data/ | * Further **profile data/ | ||
* Which **roles / group memberships** are sent to the client on successful login. The data fields and groups can be mapped to different names, if the client cannot handle Admidio' | * Which **roles / group memberships** are sent to the client on successful login. The data fields and groups can be mapped to different names, if the client cannot handle Admidio' | ||
Line 188: | Line 204: | ||
- | ===== Specific Instructions for Individual Client Apps ===== | ||
- | | [[en: | + | ====== Setting up SSO via OpenID Connect (OIDC) ====== |
- | | [[en: | + | |
- | |{{: | + | |
- | | [[en: | + | |
+ | ===== A. Basic Setup for Admidio as an OpenID Connect ID Provider ===== | ||
- | ====== Setting up SSO via OpenID Connect | + | Admidio' |
+ | {{ : | ||
- | <WRAP center round todo 60%> | + | ==== 1. Generating a Cryptographic Key for Signing and Encryption ==== |
- | todo box | + | |
- | </ | + | |
+ | * The first thing to do is to create a cryptographic key (typically an RSA key with 2048 bit). If SAML 2.0 and OpenID are used, they can share the same RSA key. | ||
+ | * To manage keys, use the "SSO cryptographic Keys Administration" | ||
+ | * {{ : | ||
+ | * Also enter the URL of the Admidio installation as " | ||
+ | {{ : | ||
+ | * The key should now be listed and activated. Return | ||
+ | | ||
+ | ==== 2. Configuring Admidio as OpenID Connect IdP ==== | ||
+ | * In the SSO section of the preferences, | ||
+ | * **Issuer**: The URL of your installation (needs to be a **unique ID**, the URL is usually used; Some clients require this to the the base URL, others accept any random string) | ||
+ | * **Key for signatures**: | ||
+ | * Save | ||
+ | {{ : | ||
+ | |||
+ | The Preferences page also lists all the relevant URLs (endpoints) to set up the client as a Relying Party. Particularly useful will be the Discovery URL, which provides all data to set up a client (RP) in JSON format. If an app supports automatic discovery, this will automatically do the basic setup. Otherwise you will have to copy the provided endpoint URLs to the client' | ||
+ | {{ : | ||
+ | |||
+ | In contrast to SAML, the metadata does not contain the public certificate. In OpenID, there is a separate endpoint (the " | ||
+ | Also notice that the discovery document lists all allowed scopes and technical details about the internal OpenID settings. | ||
+ | |||
+ | Admidio is now **ready to provide single-sign-on functionality to Relying Parties**. | ||
+ | |||
+ | Each RP first needs to be set up with the URLs to connect to Admidio. This can ideally be done by providing the RP with the discovery link. After that, Admidio needs to be configured to accept login requests from the RP. Unfortunately, | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== B. Configuring an App (Relying Party) to use SSO with Admidio ===== | ||
+ | |||
+ | |||
+ | Once Admidio is set up to act as an OpenID IdP, the clients (Relying Parties, " | ||
+ | |||
+ | * **Discovery URL** (optional; for automatic setup of clients): https:// | ||
+ | * If your RP supports auto-configuration, | ||
+ | * **IdP Isuer** (unique identifier of the Admidio instance): https:// | ||
+ | * **Authorization Endpoint** (where the RP sends the login request): https:// | ||
+ | * **Token Endpoint** (where the RP sends requests to convert an auth code to a token, i.e. an app-specific password replacement): | ||
+ | * **Userinfo Indpoint** (where the RP can request details about the user): | ||
+ | * **Scopes** (which groups of profile data are requested by the client): Any of openid (required), profile, address, phone, email, custom, groups, roles | ||
+ | * **User attribute mapping**: Which data fields (OpenID claims) returned by Admidio correspond to the login name, the full name, the email and possibly the user's group memberships in the RP system. | ||
+ | |||
+ | In addition each client typically has settings to for further customization. | ||
+ | Also, some clients offer a setting that SAML login is only possible for users that are already manually created in the RP, while others offer a setting to automatically create user accounts on successful SAML login. | ||
+ | |||
+ | The details always depend on the particular client. See the client-specific instructions for details for a particular client. Other clients should work, too, if they properly implement SAML. The configuration will be similar to the documented clients. | ||
+ | |||
+ | |||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | [[en: | ||
+ | |||
+ | |||
+ | ===== C. Configuring Admidio with the Relying Party ===== | ||
+ | |||
+ | |||
+ | Once the client is set up to send authentication requests to Admidio, Admidio needs to be configured to respond to them. All OpenID clients (Relying Parties) are configured in the SSO Client Administration page, which can be reached from the SSO Preferences page (https:// | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | To ensure only legitimate login requests from the real client are processed, Admidio needs the entity ID and the Redirect URI. In addition, Admidio will generate a Client Secret (a random string) that needs to be copied to the client' | ||
+ | The following settings are needed for setup. They MUST be consistent with the settings configured in the OpenID Connect client (RP). | ||
+ | |||
+ | * **Client ID** (unique identifier of the client): typically the URL of the OpenID client (RP)((Some RPs use basic auth by default, which does not allow special characters in the username. In this case, the URL MUST NOT be used, as this will prevent successful login! Other OpenID clients hardcode the client ID as their URL.)) | ||
+ | * **Client Secret** (basically the client' | ||
+ | * **Redirect URI** (where the user is redirected after successful login) | ||
+ | |||
+ | * **User ID field**: Whether the client gets the numeric Admidio user id, the globally unique UUID, or the user's login name as user ID | ||
+ | * **Permitted scopes**: OpenID defines certain groups of profile data, for which permission can be granted. The RP will include the scopes it is interested in in its login request, and the OpenID Provider (OP, Admidio in our case) will return the profile fields (" | ||
+ | * Further **profile data/ | ||
+ | * Which **roles / group memberships** are sent to the client on successful login. The data fields and groups can be mapped to different names, if the client cannot handle Admidio' | ||
+ | |||
+ | In addition each client typically has settings to require sent or received SAML messages to be signed and/or encrypted to ensure a secure login process. The details depend on the capabilities of the client. Some clients do not support encryption, other require all SAML messages to be signed (for good reason!). | ||
+ | {{: | ||