Integrate your existing Single-Sign-On (SSO) solution using the SAML protocol and provide your users with a convenient way to log in.
This module integrates HumHub with a SAML 2.0 Identity Provider (IdP) so your users can sign in via Single Sign-On.
Standard SAML claims (id, email, username, firstname, lastname) are auto-detected from a curated list of common attribute names — LDAP OIDs, ADFS / SOAP schemas, Microsoft / Azure AD claims, raw shortnames. No manual attribute mapping is needed for the default fields. Use the Attribute mapping setting only to override the auto-detection or to map custom profile fields.
Works with the standard SAML 2.0 SP profile. Use the IdP metadata import.
http://schemas.xmlsoap.org/… claim URLs, so either form works.AD FS often rejects unsigned outgoing logout messages. If you use Single Logout, enable Sign LogoutRequest and Sign LogoutResponse under Security and configure the HumHub SP keypair under HumHub identity (Service Provider).
Works out of the box:
Standard claims are auto-detected — no attribute-mapping changes needed.
Older versions of this manual recommended enabling Single Role Attribute on Keycloak's
role_listmapper. That workaround is no longer required.
Works via the standard SP metadata import. In Okta, create the application via Applications → Create App Integration → SAML 2.0 and either upload HumHub's SP metadata or paste in the individual values from the HumHub Metadata tab.
Works via the Enterprise Applications → New application → Create your own application → Non-gallery flow. Upload HumHub's SP metadata under Single sign-on → SAML → Upload metadata file. The HumHub auto-detection recognises Azure-AD's http://schemas.microsoft.com/identity/claims/* claim names out of the box.
Any SAML 2.0–compliant IdP should work via the standard metadata exchange. If you hit an integration issue, please open one at humhub/saml-sso-issues — include the IdP name/version and any error messages from the HumHub log (Administration → Information → Logging).
By default SAML acts as a pure authentication client — new users that sign in through SAML are created the same way as form-based self-registrations. Their profile fields stay editable and admin approval follows the global Require approval before login setting.
The Users section in the SAML settings offers two checkboxes to change this:
The flag is only applied to new users created via SAML — existing users keep their original provisioning state.
Several settings under Security — signed AuthnRequest, signed LogoutRequest / LogoutResponse, encrypted NameID / Assertion — require a HumHub-side X.509 keypair so the SP can sign outgoing messages and decrypt incoming encrypted content. Create a self-signed one:
openssl req -newkey rsa:3072 -new -x509 -days 3652 -nodes -out saml.crt -keyout saml.pem
Paste the contents into the HumHub identity (Service Provider) section of the SAML settings:
saml.pem → HumHub private keysaml.crt → HumHub certificate (X.509)After saving, the IdP needs to learn the new SP certificate too — re-download the SP metadata XML from the HumHub Metadata tab and re-import it on the IdP side.
SAML defines two HTTP bindings for transporting messages between SP and IdP. HumHub's current support:
| Direction | What HumHub supports |
|---|---|
| SP → IdP (AuthnRequest, login) | HTTP-Redirect only |
| IdP → SP (Response with Assertion, ACS) | HTTP-POST (standard) |
| SP → IdP (LogoutRequest) | HTTP-Redirect only |
| IdP → SP (LogoutRequest / LogoutResponse, SLO callback) | HTTP-Redirect and HTTP-POST (both accepted) |
Known limitation: the bundled onelogin/php-saml library does not support HTTP-POST for outgoing AuthnRequest or LogoutRequest. Most IdPs accept both — the limitation only matters when an IdP specifically requires HTTP-POST for these directions (rare, seen with some hardened enterprise ADFS setups and a few large-AuthnRequest signed-flow scenarios).
If you need HTTP-POST for outgoing requests, please open an issue at humhub/saml-sso-issues describing the IdP you're integrating with — implementing it requires custom code outside the OneLogin library and we'll prioritise based on real demand.
The settings exposed in the admin form cover the common cases. For exotic deployments, the underlying OneLogin SAML library accepts many more options. Override anything in the SP / IdP / security sections via protected/config/common.php:
<?php
return [
'modules' => [
'saml-sso' => [
'advancedSettings' => [
'security' => [
// Example: relax destination validation if your IdP
// rewrites the ACS URL through a proxy.
'relaxDestinationValidation' => true,
],
'sp' => [
// ...
],
'idp' => [
// ...
],
],
],
],
];
Reference:
advancedSettings is merged on top of the values built from the admin form, so admin-form settings win unless the same key is set in advancedSettings.
openssl, dom, libxml, zlib. All ship with standard PHP builds on the major Linux distributions.X.509 handling uses the system OpenSSL library — no separate installation step required.