Skip to content

feat(netbird): structured OIDC/SSO configuration (#7)#8

Merged
mikkeldamsgaard merged 2 commits intomainfrom
issue-7-oidc-sso-configuration
Feb 26, 2026
Merged

feat(netbird): structured OIDC/SSO configuration (#7)#8
mikkeldamsgaard merged 2 commits intomainfrom
issue-7-oidc-sso-configuration

Conversation

@mikkeldamsgaard
Copy link
Contributor

@mikkeldamsgaard mikkeldamsgaard commented Feb 26, 2026

Summary

  • Add comprehensive oidc.* values section for full OIDC/SSO configuration (device auth flow, PKCE flow, IdP manager with provider-specific support)
  • Secret injection via secretKeyRef follows existing chart patterns — no plaintext secrets in rendered config
  • Dashboard AUTH_AUTHORITY auto-derives from server.config.auth.issuer when not explicitly set
  • Keycloak e2e test validates OIDC middleware activation in-cluster
  • 22 new unit tests (190 total), all passing

Test plan

  • helm lint charts/netbird — passes
  • helm unittest charts/netbird — 190 tests pass
  • make e2e-oidc-keycloak — Keycloak OIDC e2e passes (server starts, middleware returns 401 for unauthenticated requests, Keycloak token acquisition works)
  • make e2e-sqlite — existing tests pass (no regression)
  • CI workflow runs all e2e jobs (sqlite, postgres, mysql, oidc-keycloak)

Closes #7

🤖 Generated with Claude Code

mikkeldamsgaard and others added 2 commits February 26, 2026 10:10
Add a comprehensive oidc.* values section that renders full OIDC/SSO
configuration into the server config.yaml, replacing the need for
extraEnv hacks. Default oidc.enabled: false — no breaking changes.

Configuration sections:
- oidc.audience, userIdClaim, configEndpoint, authKeysLocation
- oidc.deviceAuthFlow: RFC 8628 device authorization flow
- oidc.pkceAuthFlow: RFC 7636 PKCE authorization flow
- oidc.idpManager: IdP management (keycloak, auth0, azure, zitadel)

Secret injection follows existing pattern: secretName/secretKey for
Kubernetes secretKeyRef, with envsubst placeholders in config template.

Dashboard AUTH_AUTHORITY now falls back to server.config.auth.issuer
when dashboard.config.authAuthority is empty.

Testing:
- 22 new unit tests (190 total, all passing)
- Keycloak OIDC e2e test: deploys Keycloak in-cluster, configures
  realm/clients/users via REST API, verifies OIDC middleware active

Closes #7

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add end-to-end test for Zitadel IdP integration deployed in-cluster
alongside PostgreSQL. The test bootstraps Zitadel with a machine user
and PAT, then uses the Management API to create a project, OIDC apps
(Dashboard + CLI), a service user with client_credentials, and a test
human user. Dynamic client IDs are substituted into the values file
at runtime.

Key implementation details:
- Three-phase Zitadel deployment: init container (schema), setup init
  container (migrations + instance), main container (server)
- Alpine sidecar for PAT file reading (Zitadel image is distroless)
- emptyDir volume at /tmp for PAT output (distroless lacks writable /tmp)
- enableServiceLinks: false to prevent K8s ZITADEL_PORT env var conflict
- Cluster DNS as EXTERNALDOMAIN for Host header validation

Tests verify: OIDC middleware returns 401, OIDC discovery works, and
client_credentials token acquisition succeeds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mikkeldamsgaard mikkeldamsgaard merged commit a3a05d8 into main Feb 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(netbird): structured OIDC/SSO configuration with provider-specific e2e tests

1 participant