Skip to content

feat(auth): implement oidc authentication and session management#8854

Open
rbstp wants to merge 1 commit intoapache:mainfrom
rbstp:feat/oidc
Open

feat(auth): implement oidc authentication and session management#8854
rbstp wants to merge 1 commit intoapache:mainfrom
rbstp:feat/oidc

Conversation

@rbstp
Copy link
Copy Markdown
Contributor

@rbstp rbstp commented Apr 26, 2026

Summary

This PR adds OIDC login behind a default-off AUTH_ENABLED switch. Providers are configured via OIDC_PROVIDERS plus per-name env blocks, so a deployment can offer Entra ID and Google (or any other OIDC IdP) side by side. Sessions are signed JWTs in HttpOnly cookies, backed by a new auth_sessions table so they can be revoked server-side without rotating SESSION_SECRET.

CSRF is enforced on state-changing requests when the caller is using the session cookie; API-key, Basic auth, and proxy-header callers are unaffected. Azure Workload Identity is supported for the Entra provider so AKS deployments can drop CLIENT_SECRET in favor of a federated SA-token assertion.

When AUTH_ENABLED=false, which is the default so no need to add it, the system behaves exactly as before.

env.example contains the variables needed to add the OIDC login.

Does this close any open issues?

Refs: #8694
Refs: https://devlake-io.slack.com/archives/C03AJH1HBAT/p1776917914734679

Screenshots

Example with Google, validated with Entra ID as well.
image
image
image
image

Other Information

Validated with Entra ID (AAD) and Google Auth, but it should work with other providers as well, as long as they respect the OIDC spec.

Expect a 401 in DevTools on first load before the redirect to /login. It is the axios interceptor bouncing unauthenticated requests through the OIDC flow, not a bug.

@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. component/config-ui This issue or PR relates to config-ui component/framework This issue or PR relates to the framework pr-type/feature-development This PR is to develop a new feature labels Apr 26, 2026
@rbstp rbstp force-pushed the feat/oidc branch 2 times, most recently from e04a68d to 788ee11 Compare April 26, 2026 14:15
DevLake had no native OIDC login. The existing protections: nginx Basic auth and /rest/* Bearer tokens, all sit outside the API and don't give you SSO at the application layer.

This adds an OIDC login flow behind a default-off AUTH_ENABLED switch. Multiple providers (Entra ID, Google, etc.) can be configured side by side, sessions are revocable server-side, and CSRF is enforced on state-changing requests when authenticating via the session cookie.

When AUTH_ENABLED=false the system behaves exactly as before; existing Basic auth, oauth2-proxy, and API-key flows are untouched.

Refs: apache#8694

Refs: https://devlake-io.slack.com/archives/C03AJH1HBAT/p1776917914734679
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/config-ui This issue or PR relates to config-ui component/framework This issue or PR relates to the framework pr-type/feature-development This PR is to develop a new feature size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant