Starting with version 5.0, Admidio can be used as a central login system for other applications using Single Sign-On (SSO).
When a user signs in to a connected application, they are redirected to Admidio for authentication, and after successful login are redirected back to the appplication, where they are automatically signed in.
Users only need to log in to Admidio and can access other configured applications without entering their username and password again. The connected applications do not need to store or process the users' passwords themselves.
Admidio supports the two most widely used SSO protocols:
With both protocols, Admidio authenticates the user and provides the connected application with the information required to sign the user in. In SAML terminology, Admidio acts as an Identity Provider (IdP). In OpenID Connect, the corresponding term is OpenID Provider (OP).
The following sections describe the general configuration for both protocols using the following systems as examples:
Other systems like Prestashop do not provide any freely available SAML or OpenID plugin, only some very expensive commercial extensions.
All examples here use the domain https://admidio.demo.open-tools.net/ or https://admidio.local as Admidio domain and https://[appname].demo.open-tools.net/ or https://[appname].local for the client applications.
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's user accounts for their logins), one has to take three steps:
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, and client-specific instructions are available at separate pages.
To set up a web application (the “Relying Party”=“RP”) for single-sign-on through Admidio as an OIDC Identity Provider (so that other applications will use Admidio's user accounts for their logins), one has to take three steps:
provides a link to the discovery URL for automatic client setup (https://[ADMIDIO_URL]/modules/sso/index.php/oidc/.well-known/openid-configuration).
This page will describe the generic setup of a Admidio and an OpenID client. It has been tested with several OpenID-ready applications, and client-specific instructions are available at separate pages
The default login process to an app (the “Service Provider”, i.e. SP) works with the following steps:
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 (“idP”). That identity provider needs to be trusted, and it will take over the part of checking whether a user has access permissions (by e.g. entering a password or using a fingerprint, etc.).
There are two established technical protocols for Single-Sign-On: SAML 2.0 (XML-based, widely used by large-scale bussiness applications and e.g. Microsoft ADFS) and OpenID Connect (OIDC) (JSON-based using “Tokens”; used by many web / social apps like Google, Facebook, etc.).
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, the same steps of entering a password are done, just at a different system. The browser redirects involved in the flow, are hardly noticed by the user and don't require user interaction.
There are some things to notice about the way SAML authentication works:
OpenID Connect is based on exchanging data with JSON objects. It is an extension of the OAuth 2.0 protocol, which only handles authentication. The OpenID layer adds additional profile information and permissions, but uses OAuth for the basic authorization.
Rather than working only with browser redirects like SAML, OpenID is based on OAuth and extensively uses direct communication (“backchannel”) between the Relying Party and the IdP. Rather than documenting only a successful login, OpenID separates authentication (successfull login) and authorization (roles that grant user rights). It also does not rely on an active session at the IdP. Rather it generates a dedicated password (the “token”) for the client and thus replaces the user's individual password with app-specific passwords, which are handled internally by the client and the IdP without the user noticing. When such a token expires, another (refresh) token can be used to create a new token, so that no new login is required. All this is done in the background and the user experience is basically the same as with a direct login or with SAML.
todo box
Admidio's SSO configuration is done in the preferences (Tab “Sign in & Security”, section “Single-Sign-On”).
The Preferences page also lists all the relevant data to set up the client as a Service Provider. If the client supports automatic setup from metadata, you can copy the metadata URL directly from this page and paste it in the client configuration. Use the “Copy” icon right of the URL.
The SSO settings also provide an advanced section, where you can select or generate crypto keys for the signatures and encryption of the SAML messages. A default key will be generated automatically.
Admidio is now ready to provide single-sign-on functionality to Service Providers.
Next Steps: Configure the client application for use with Admidio
That metadata URL provides all data to set up a client (SP) in XML format and can be automatically processed by the SAML client, if supported. Here is an example of such a metadata xml:
<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" entityID="https://admidio.local" ID="_1df88e3a68af770dd23bf870b343990d38ce5c4cf0"> <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:SignedInfo> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/> <ds:Reference URI="#_1df88e3a68af770dd23bf870b343990d38ce5c4cf0"> <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/> <ds:DigestValue>5ErkuUnL6eMZ0LnGvWGmZDrF/peW7b81WHQgFGCIB5A=</ds:DigestValue> </ds:Reference> </ds:SignedInfo> <ds:SignatureValue>BT1Rih/IZXn...8mSd0jg==</ds:SignatureValue> <ds:KeyInfo> <ds:X509Data> <ds:X509Certificate>MIID4DCCAsigAwIBA...MyLpVB5</ds:X509Certificate> </ds:X509Data> </ds:KeyInfo> </ds:Signature> <IDPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" WantAuthnRequestsSigned="true"> <KeyDescriptor use="signing"> <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:X509Data> <ds:X509Certificate>MIID4DCCAsigAwIBA...MyLpVB5</ds:X509Certificate> </ds:X509Data> </ds:KeyInfo> </KeyDescriptor> <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://admidio.local/modules/sso/index.php/saml/slo"/> <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://admidio.local/modules/sso/index.php/saml/slo"/> <NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</NameIDFormat> <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://admidio.local/modules/sso/index.php/saml/sso"/> <SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://admidio.local/modules/sso/index.php/saml/sso"/> </IDPSSODescriptor> </EntityDescriptor>
Notice that it contains both the public key / certificate of the signing and encryption keys, as well as the URLs to the SingleSignOnService (SSO) and the SingleLogOutService (SLO) at the admidio installation. Furthermore, the first half of the XML contains the cryptographic signature of the XML, signed with the private key to prove that the metadata file actually comes from the admidio installation and not from some adversary.
The SSO setup in Admidio aims to be as straightforward and painless as possible. For this reason, some advanced settings are not shown by default, but can still be configured in the “Advanced settings” are of the SAML preferences. Click on the small triangle to show or hide the advanced section.
Once Admidio is set up to act as SAML 2.0 IdP, clients (Service Providers, “SP”) can Admidio as their login provider. Many systems support SAML 2.0 out of the box or with a plugin. The following settings are needed for setup. They are also available for copying at Admidio's SSO preferences page, as well as in the metadata xml.
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 at all, other require all SAML messages to be signed (for good reason!). None of these settings are required, but the settings in the client and in Admidio must be consistent, i.e. if a client does not support encryption, Admidio must not require encryption.
Some clients also support Just-in-time user-provisioning (meaning users will be created on-the-fly the first time they are logged in), while others require all users to be presents before they can log in through SAML.
The details always depend on the particular client. We have extensively tested Admidio's SAML implementation with the following clients and provide detailed setup instructions for them. Other clients should work, too, if they properly implement SAML, and their configuration will be similar to the documented clients.
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://admidio.demo.open-tools.net/modules/preferences.php?panel=sso) from the SSO SAML preferences page.
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's SAML client section, one can input the metadata URL and Admidio will pre-configure the client, but manual adjustments are possible (and in many areas even needed).
If your client application does not provide SAML configuration as metadata for automatic setup, you need to copy the following settings from the client into Admidio's client configuration:
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!).
Admidio's general SSO configuration is done in the preferences (Tab “Sign in & Security”, section “Single-Sign-On”).
The SSO settings also provide an advanced section, where you can select or generate crypto keys for the signatures and encryption of the OIDC messages. A default key will be generated automatically.
The Preferences page also lists all the relevant URLs (endpoints) to set up the client as a Relying Party. If client supports automatic discovery, you can copy the discovery URL from this page and paste it in the client configuration. Use the “Copy” icon right of the URL. Otherwise you will have to copy the provided endpoint URLs to the client's config. Here is an example of such a discovery JSON:
{
"issuer": "https://admidio.local/modules/sso/index.php/oidc",
"authorization_endpoint": "https://admidio.local/modules/sso/index.php/oidc/authorize",
"token_endpoint": "https://admidio.local/modules/sso/index.php/oidc/token",
"userinfo_endpoint": "https://admidio.local/modules/sso/index.php/oidc/userinfo",
"jwks_uri": "https://admidio.local/modules/sso/index.php/oidc/jwks",
"introspection_endpoint": "https://admidio.local/modules/sso/index.php/oidc/introspect",
"revocation_endpoint": "https://admidio.local/modules/sso/index.php/oidc/revoke",
"end_session_endpoint": "https://admidio.local/modules/sso/index.php/oidc/logout",
"frontchannel_logout_supported": true,
"frontchannel_logout_session_supported": true,
"backchannel_logout_supported": true,
"backchannel_logout_session_supported": true,
"scopes_supported": ["openid", "profile", "email", "address", "phone", "groups", "custom"],
"response_types_supported": ["code"],
"response_modes_supported": ["query"],
"grant_types_supported": ["authorization_code", "refresh_token"],
"code_challenge_methods_supported": ["S256"],
"subject_types_supported": ["public"],
"id_token_signing_alg_values_supported": ["RS256"],
"token_endpoint_auth_methods_supported": ["client_secret_post", "client_secret_basic"],
"introspection_endpoint_auth_methods_supported": ["client_secret_basic", "client_secret_post"],
"revocation_endpoint_auth_methods_supported": ["client_secret_basic", "client_secret_post"],
"claims_supported": [
"sub", "iss", "aud", "exp", "iat", "auth_time", "nonce", "acr", "amr", "sid",
"uuid", "preferred_username", "name", "family_name", "given_name", "email", "phone_number", "address",
"groups", "locale", "website", "gender", "birthdate"
],
"claims_parameter_supported": false,
"request_parameter_supported": false,
"request_uri_parameter_supported": false
}
In contrast to SAML, the metadata does not contain the public certificate. In OpenID, there is a separate endpoint (the “jwks_uri” in the discovery document) that provides the current key in “JSON Web Key Sets” (JWKS) format. 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, OpenID Connect does not provide an automatic way to transfer configuration data from the RP to the IdP, so the client ID and the Redirect URL needs to be manually copied from the RP to Admidio's OpenID client settings. The details on where to find these depend on the actual client app.
Once Admidio is set up to act as OpenID Identity Provider, clients can be configured to use Admidio as their login provider. Many systems support OpenID Connect out of the box or with some plugin. The following settings are needed for setup. They are also available for copying at Admidio's SSO preferences page, as well as in the metadata json (from the discovery URL).
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. We have extensively tested the following clients, but other OIDC clients should work as well. The configuration will be similar to the documented clients.
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://admidio.local/modules/preferences.php?panel=sso) from the SSO OIDC preferences page.
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's configuration and acts as a client password. The following settings are needed for setup. They MUST be consistent with the settings configured in the OpenID Connect client (RP).
In addition each client typically has some more settings regarding fields ⇔ claims mapping, groups, auto-generating accounts for new logins, etc. The details depend on the capabilities of the client.
The advanced settings for OIDC and SAML 2.0 in the preferences page allow selecting a different key or generating a new key. The advanced settings are a closed section within the SAML / OIDC settings and offer a dropdown list to select an existing key for signatures. Additionally, the button to the right links to Admidio's cryptographic key administration.