If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.
A DDEV add-on that provisions a project-specific SimpleSAMLphp Identity Provider (IdP) as a dedicated, optional DDEV service.
This add-on is designed to streamline local SAML integration and testing for web applications (especially Drupal sites utilizing the samlauth module) by providing a completely self-contained, fully customizable local SAML Identity Provider.
saml-idp), meaning the container only runs when you actively need to develop/test SAML authentication.https://idp.<your-project>.ddev.site/simplesaml/. Fully integrated with DDEV’s router and trusting your local mkcert CA for automatic HTTPS termination.getenv('SAML_IDP_PRIMARY_HOST') and getenv('SAML_SP_PRIMARY_HOST').idp.crt, idp.key, sp.crt, sp.key) are automatically initialized inside .ddev/saml-idp/certs/ upon container boot. This folder is gitignored automatically.ddev add-on get) updates only the core container infrastructure and templates, never overwriting your custom configuration, metadata, or certificates in .ddev/saml-idp/.example-userpass SimpleSAMLphp auth source, populated with realistic SAML user attributes.PHP_IMAGE_TAG, default: 8.4) and SimpleSAMLphp library version (SSP_VERSION, default: ^2.2) via DDEV environment variables.linux/arm64) and Intel/AMD (linux/amd64) machines.ddev add-on get Pronovix/ddev-saml-idp
Start/Run the service:
saml-idp profile to your .ddev/config.local.yaml (or .ddev/config.yaml) file:
```yaml
profiles:
Then restart your project:
```bash
ddev restart
ddev restart first to ensure the router is ready, then start with the profile:
ddev restart
ddev start --profiles=saml-idp
Note
On the very first start after installation, the container image is built from scratch. The ddev restart step above accounts for this. Subsequent starts work normally without any extra steps.
Once running, the SAML IdP is accessible via the following local URLs:
https://idp.<your-project>.ddev.site/simplesaml/https://idp.<your-project>.ddev.site/simplesaml/module.php/saml/idp/metadatahttps://idp.<your-project>.ddev.site/simplesaml/saml2/idp/SSOService.phphttps://idp.<your-project>.ddev.site/simplesaml/saml2/idp/SingleLogoutService.phpadmin (configured via SSP_ADMIN_PASSWORD)default_development_secret_salt_12345678_override_me (configured via SSP_SECRET_SALT)The default authentication source (example-userpass) comes preloaded with three test personas and standard SAML attributes (including uid, email, givenName, sn, cn, and groups):
| Username | Password | Display Name (cn) |
Primary E-mail (email) |
Roles / Affiliations (groups) |
|---|---|---|---|---|
admin |
password |
Admin User | [email protected] |
administrator, editor |
editor |
password |
Content Editor | [email protected] |
editor |
user1 |
password |
Test User 1 | [email protected] |
member |
samlauthSetting up SAML integration in local Drupal development is incredibly easy with this add-on. Here is a step-by-step configuration guide for the Drupal SAML Authentication (samlauth) module:
samlauthRun the following in your DDEV project to download and enable the module:
ddev composer require drupal/samlauth
ddev drush pm:enable samlauth -y
Note
Automatic Settings Overrides:
When you run ddev add-on get Pronovix/ddev-saml-idp, the installer automatically appends a block of configuration overrides to your settings.local.php (or project.local.settings.php) file between the markers:
// --- BEGIN DDEV SAML IDP OVERRIDES ---
and
// --- END DDEV SAML IDP OVERRIDES ---
This block automatically configures the Drupal samlauth module at runtime with optimal development values (pointing directly to the correct certificate files and SimpleSAMLphp endpoints). This means you do not even need to configure these settings manually in the Admin UI!
If you wish to configure or verify them manually via the Drupal Admin UI (/admin/config/people/saml), you MUST empty or comment out the content inside the // --- BEGIN DDEV SAML IDP OVERRIDES --- block first. Otherwise, the PHP settings overrides take precedence and any settings you save in the UI will be ignored.
The IdP requires your Service Provider (Drupal) to sign its authentication requests. The DDEV SAML IdP container automatically generates matching keys for this purpose on startup inside .ddev/saml-idp/certs/.
Since .ddev/ is mounted inside the DDEV web container at /mnt/ddev_config/, your Drupal site can point directly to these keys on the local filesystem:
/mnt/ddev_config/saml-idp/certs/sp.key (or with file prefix file:/mnt/ddev_config/saml-idp/certs/sp.key)/mnt/ddev_config/saml-idp/certs/sp.crt (or with file prefix file:/mnt/ddev_config/saml-idp/certs/sp.crt)samlauth Module Settings (Manual UI Verification)If you have cleared/commented out the settings overrides block and want to set up samlauth manually in the Drupal UI at /admin/config/people/saml, enter the following values:
[site:base-url] (or https://<your-project>.ddev.site)Filefile:/mnt/ddev_config/saml-idp/certs/sp.keyfile:/mnt/ddev_config/saml-idp/certs/sp.crthttps://idp.<your-project>.ddev.site/simplesaml/saml2/idp/metadatahttps://idp.<your-project>.ddev.site/simplesaml/saml2/idp/SSOService.phphttps://idp.<your-project>.ddev.site/simplesaml/saml2/idp/SingleLogoutService.phpfile:/mnt/ddev_config/saml-idp/certs/idp.crt into this field, OR copy and paste the entire PEM content of .ddev/saml-idp/certs/idp.crt (including the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- lines).Attributeuiduid (or cn)emailhttps://<your-project>.ddev.site/saml/login.https://idp.<your-project>.ddev.site.user1, password password) and click Login.To add new test accounts or modify user attributes, open .ddev/saml-idp/config/authsources.php in your editor and add entries under the example-userpass array using standard SimpleSAMLphp conventions. Commit this file to git to share these test personas with your entire development team.
If you need to connect more than one SP (for example, if you are developing a multi-site Drupal architecture), edit .ddev/saml-idp/metadata/saml20-sp-remote.php to register other remote SP metadata configurations.
You can easily customize the PHP version or SimpleSAMLphp version without modifying the add-on source. Add/update the following environment variables in .ddev/.env (or configure them via .ddev/docker-compose.saml-idp.yaml build arguments):
# Pin the PHP version of the IdP container (e.g., 8.2, 8.3, 8.4)
PHP_IMAGE_TAG=8.3
# Pin the exact SimpleSAMLphp composer version or version constraint
SSP_VERSION=2.2.0
Run ddev restart to rebuild the container with your newly specified versions.
ddev logs -s saml-idp
ddev restart if the profile is persistent, or ddev start --profiles=saml-idp if starting on-demand):
rm -f .ddev/saml-idp/certs/*
ddev restart
# OR if running on-demand:
# ddev start --profiles=saml-idp
The entrypoint script will automatically detect the missing certificates and securely generate a brand-new, matching cryptographic key set.
Contributed and maintained by @Pronovix.
If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.