If you find this add-on useful, please star it on GitHub — stars show appreciation and help maintainers know their work matters.
ddev-oidc-provider-mock)This DDEV add-on integrates ghcr.io/geigerzaehler/oidc-provider-mock into your DDEV environment to provide a mock OpenID Connect (OIDC) identity provider out of the box for local development and testing.
oidc-provider-mock), so the container runs only when you actively need it.admin, alice, bob) with zero mandatory setup steps.openid_connect, oauth2_client, custom PHP/JS applications, etc.).https://oidc.<site>.<tld> (e.g. https://oidc.mysite.ddev.site) so both browser front-channel redirects and server-to-server back-channel API calls hit the exact same Issuer URL..ddev/oidc-provider-mock/users.yaml which can be customized and committed to your project’s version control.ddev add-on get Pronovix/ddev-oidc-provider-mock
ddev restart && ddev start --profiles=oidc-provider-mock
When updating this add-on, a standard ddev restart or ddev restart --no-cache will not rebuild or pull the service container if changes are made to profile-gated services (tracked in ddev/ddev#8817).
To update the add-on and properly restart the OIDC Provider Mock service:
ddev add-on get Pronovix/ddev-oidc-provider-mock
ddev debug rebuild -s oidc-provider-mock
ddev restart && ddev start --profiles=oidc-provider-mock
Note:
ddev debug rebuild -s <service>(or its aliasddev utility rebuild -s <service>) for profile-gated services requires DDEV >= v1.25.3 (ddev/ddev#8463). Following up withddev restart && ddev start --profiles=oidc-provider-mockensures all project containers and profile services restart cleanly together (see ddev/ddev#7904).
By default, this add-on provides an on-demand service using Docker Compose profiles (oidc-provider-mock). It only starts when explicitly requested so that local resources are not consumed during unrelated development tasks.
oidc-provider-mock profile whenever you need OIDC authentication:
ddev start --profiles=oidc-provider-mock
(Or when restarting: ddev restart && ddev start --profiles=oidc-provider-mock)
Always start automatically (optional):
If you prefer the OIDC Provider Mock service to always start on every standard ddev start or ddev restart without passing the profile flag, create .ddev/docker-compose.oidc-provider-mock_enable.yaml to override and reset the profile constraint:
services:
oidc-provider-mock:
profiles: !reset []
Then restart your project:
ddev restart
Note
<site> corresponds to your DDEV project name and <tld> corresponds to your configured project_tld (default: ddev.site). The hostname dynamically adapts to custom primary domains or TLDs configured in DDEV.
| Endpoint | URL | Description |
|---|---|---|
| Issuer URL | https://oidc.<site>.<tld> |
Base OpenID Provider URL |
| Discovery | https://oidc.<site>.<tld>/.well-known/openid-configuration |
OpenID Connect discovery metadata |
| Authorization | https://oidc.<site>.<tld>/oauth2/authorize |
HTML authorization form / redirect |
| Token | https://oidc.<site>.<tld>/oauth2/token |
Exchange code for tokens |
| Userinfo | https://oidc.<site>.<tld>/userinfo |
Fetch authenticated user claims |
| Client Registration | POST https://oidc.<site>.<tld>/oauth2/clients |
Dynamic client registration (optional) |
| Dynamic Claims API | PUT https://oidc.<site>.<tld>/users/{sub} |
Inject/update user claims during test runs |
Tip
For any additional endpoints, or to view all available paths discovered dynamically, inspect your project’s discovery metadata at https://oidc.<site>.<tld>/.well-known/openid-configuration, or consult the official OIDC Provider Mock Documentation.
| Command | Description |
|---|---|
ddev describe |
View service status and exposed endpoints |
ddev logs -s oidc-provider-mock |
Check OIDC Provider Mock logs |
Edit .ddev/oidc-provider-mock/users.yaml in your project to modify existing users (admin, alice, bob) or add custom users and claims (such as given_name, family_name, and roles). Run ddev restart after making changes.
Example user configuration:
- sub: alice
email: [email protected]
name: Alice Smith
given_name: Alice
family_name: Smith
preferred_username: alice
roles:
- editor
To pass extra flags to oidc-provider-mock (such as --require-registration or --require-nonce), add OIDC_PROVIDER_MOCK_EXTRA_ARGS to .ddev/.env.oidc-provider-mock:
OIDC_PROVIDER_MOCK_EXTRA_ARGS="--require-registration --require-nonce"
Then run ddev restart.
To override the Docker image used by the service, set OIDC_PROVIDER_MOCK_DOCKER_IMAGE in .ddev/.env.oidc-provider-mock:
OIDC_PROVIDER_MOCK_DOCKER_IMAGE="ghcr.io/geigerzaehler/oidc-provider-mock:latest"
To connect any OIDC client module or application to this mock provider:
https://oidc.<site>.<tld> (or use the environment variable $OIDC_ISSUER_URL inside the web container)my-client-id)my-client-secret)openid email profilehttps://oidc.<site>.<tld>/oauth2/authorizehttps://oidc.<site>.<tld>/oauth2/tokenhttps://oidc.<site>.<tld>/userinfoContributed 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.