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.yaml or Docker Compose environment variables

Authentication Methods

Control which authentication methods are available to users. All methods are configured in the Helm chart values.yaml:

Note

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 valueEnvironment variable
password.enabledSELFSERVICE_METHODS_PASSWORD_ENABLED
passkey.enabledSELFSERVICE_METHODS_PASSKEY_ENABLED
webauthn.enabledSELFSERVICE_METHODS_WEBAUTHN_ENABLED
totp.enabledSELFSERVICE_METHODS_TOTP_ENABLED
oidc.enabledSELFSERVICE_METHODS_OIDC_ENABLED
verificationAfterSignUp.enabledSELFSERVICE_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:

  1. Disable all other authentication methods:
  1. 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):

Note

When all authentication methods except OIDC are disabled, DevGuard automatically enters OIDC-only mode and hides alternative login options.

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.

Have feedback? We want to hear from you!

Fields marked with * are required