OIDC & Restricting Access
DevGuard supports multiple authentication methods and OpenID Connect (OIDC) providers. You can configure which authentication methods are enabled and restrict access by disabling user registration.
Requirements
- A self hosted DevGuard installation (Kubernetes or Docker Compose)
- Access to modify the Helm chart
values.yamlor Docker Compose environment variables
Authentication Methods
Control which authentication methods are available to users. All methods are configured in the Helm chart values.yaml:
Set all authentication methods to false and enable only OIDC to enforce single sign-on (SSO) authentication.
Docker Compose
With the Docker Compose deployment, Kratos is configured through environment variables in .kratos.env. Any Kratos config key can be overridden by upper-casing it and replacing . with _. Add the following lines to .kratos.env and restart the kratos service:
| Helm value | Environment variable |
|---|---|
password.enabled | SELFSERVICE_METHODS_PASSWORD_ENABLED |
passkey.enabled | SELFSERVICE_METHODS_PASSKEY_ENABLED |
webauthn.enabled | SELFSERVICE_METHODS_WEBAUTHN_ENABLED |
totp.enabled | SELFSERVICE_METHODS_TOTP_ENABLED |
oidc.enabled | SELFSERVICE_METHODS_OIDC_ENABLED |
verificationAfterSignUp.enabled | SELFSERVICE_FLOWS_VERIFICATION_ENABLED (set through KRATOS_VERIFICATION_ENABLED in .env) |
OpenID Connect (OIDC) Configuration
Enable OIDC
Configure OIDC providers in your values.yaml:
GitHub Provider
Configure GitHub as an OIDC provider:
Create the required secret:
GitLab Provider
Configure GitLab as an OIDC provider with optional integrations:
GitLab Secrets
Create the required secrets:
GitLab Auto-Setup Application
Configure an OAuth application for automatic repository setup feature:
Create the auto-setup secret:
Restricting User Registration
To disable new user registration and restrict access to existing users or OIDC-authenticated users only, modify the Kratos configuration after deployment.
Disable Registration
Edit the kratos-config ConfigMap:
Locate the registration section under selfservice.flows and set enabled: false:
Restart the Kratos deployment for changes to take effect:
Docker Compose
Add the following to .kratos.env and restart the kratos service:
OIDC-Only Mode
To enforce OIDC authentication exclusively:
- Disable all other authentication methods:
- Enable OIDC with at least one provider:
For Docker Compose, set the following in .kratos.env and restart the kratos service. The OIDC providers are passed to Kratos as a JSON list in SELFSERVICE_METHODS_OIDC_CONFIG_PROVIDERS. Kratos requires a mapper_url (a Jsonnet claims mapper, see the Kratos OIDC docs):
Advanced Configuration
DevGuard uses Ory Kratos for identity and authentication management. For advanced configuration options and detailed guides on self-hosted deployments, refer to the Ory Kratos self-hosted documentation.