Skip to content

feat: add OIDC middleware support via Traefik plugin#35

Draft
boehlke wants to merge 5 commits intoOpenSlides:mainfrom
kryptance:feature/keycloak-oidc
Draft

feat: add OIDC middleware support via Traefik plugin#35
boehlke wants to merge 5 commits intoOpenSlides:mainfrom
kryptance:feature/keycloak-oidc

Conversation

@boehlke
Copy link
Copy Markdown
Contributor

@boehlke boehlke commented Feb 19, 2026

Summary

  • Configure traefik-oidc-auth plugin when OIDC_ENABLED environment variable is set
  • Add OIDC-authenticated routes for /system/oidc-provision, /system/who-am-i, and /oauth2/* callbacks
  • Add Keycloak reverse-proxy route (/keycloak/*) and unauthenticated /system/theme endpoint
  • Redact Authorization and X-Forwarded-* headers from access logs for security

Context

This configures Traefik to act as an OIDC relying party using the traefik-oidc-auth plugin. When OIDC_ENABLED=true, Traefik intercepts unauthenticated requests and redirects to Keycloak for login. The plugin injects the JWT into the Authorization header before forwarding to backend services.

Routes that need to bypass OIDC authentication (e.g., the theme endpoint for Keycloak's login page) get explicit routers with higher priority and no middleware.

Related PRs (part of Keycloak OIDC integration):

  • All backend services consume the Authorization header injected by this middleware
  • openslides-go: validates the bearer tokens
  • openslides-auth-service: validates the bearer tokens (Python)

🤖 Co-authored with Claude Code

boehlke and others added 4 commits March 9, 2026 10:20
- Configure traefik-oidc-auth plugin when OIDC_ENABLED is set
- Add OIDC-authenticated routes for provision, who-am-i, and oauth2 callbacks
- Add Keycloak reverse-proxy route and unauthenticated theme endpoint
- Redact auth headers from access logs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update OIDC-exempt theme route from /system/autoupdate/theme to
/system/presenter/theme now that theme serving lives in the backend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v0.19.3 does not exist in the Traefik plugin registry, causing the
plugin to fail to download and all OIDC-protected routes to return 404.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add OIDC_INTERNAL_PROVIDER_URL for service-to-service OIDC discovery
over plain HTTP (Docker network), while keeping OIDC_PROVIDER_URL as
the external issuer URL validated in tokens via ValidIssuer.

This fixes the self-signed TLS certificate error when the proxy
tries to discover OIDC endpoints via its own HTTPS endpoint.
@boehlke boehlke force-pushed the feature/keycloak-oidc branch from 150e100 to 9d99b98 Compare March 9, 2026 11:34
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.

1 participant