Skip to content

feat: add optional OIDC/SSO authentication support#9

Open
fcraviolatti wants to merge 1 commit intosbabic:mainfrom
fcraviolatti:feat/oidc-support-upstream
Open

feat: add optional OIDC/SSO authentication support#9
fcraviolatti wants to merge 1 commit intosbabic:mainfrom
fcraviolatti:feat/oidc-support-upstream

Conversation

@fcraviolatti
Copy link
Copy Markdown

Summary

Adds support for any OpenID Connect compliant identity provider (Keycloak, Auth0, Okta, etc.) alongside the existing credentials login.

  • When OIDC_ISSUER_URL / OIDC_CLIENT_ID / OIDC_CLIENT_SECRET are set, a "Sign in via OIDC" button appears on the login page
  • OIDC-authenticated users share a HawkBit service account for API access (HAWKBIT_SERVICE_* env vars)
  • Existing credentials login is unchanged; both methods coexist

New environment variables

Variable Description
OIDC_ISSUER_URL OIDC issuer URL (e.g. https://keycloak.example.com/realms/myrealm)
OIDC_CLIENT_ID OAuth2 client ID
OIDC_CLIENT_SECRET OAuth2 client secret
OIDC_PROVIDER_NAME Optional label for the sign-in button (default: "OIDC")
HAWKBIT_SERVICE_USERNAME HawkBit username used for OIDC-authenticated users
HAWKBIT_SERVICE_PASSWORD HawkBit password used for OIDC-authenticated users

Implementation

  • Generic OIDC provider via wellKnown discovery + PKCE (works with any standard OIDC issuer)
  • API proxy falls back to service account credentials when the per-user auth cookie is absent but a valid OIDC session exists
  • Login page reads oidcEnabled server-side and passes it to the client container to conditionally render the OIDC button

Adds support for any OpenID Connect compliant identity provider
(Keycloak, Auth0, Okta, etc.) alongside the existing credentials login.

When OIDC is configured, a "Sign in via OIDC" button appears on the
login page. OIDC-authenticated users share a HawkBit service account
for API access (configured via HAWKBIT_SERVICE_* env vars).

New environment variables:
  OIDC_ISSUER_URL         – OIDC issuer (e.g. https://keycloak.example.com/realms/myrealm)
  OIDC_CLIENT_ID          – OAuth2 client ID
  OIDC_CLIENT_SECRET      – OAuth2 client secret
  OIDC_PROVIDER_NAME      – optional label for the sign-in button (default: "OIDC")
  HAWKBIT_SERVICE_USERNAME – HawkBit username for OIDC-authenticated users
  HAWKBIT_SERVICE_PASSWORD – HawkBit password for OIDC-authenticated users

Implementation details:
  - Generic OIDC provider in auth-options.ts (wellKnown discovery, PKCE)
  - API proxy falls back to service account credentials when the per-user
    auth cookie is absent but a valid OIDC session exists
  - Login page passes oidcEnabled flag (server-side env read) to the
    client container to conditionally render the OIDC button
  - Existing credentials login is unchanged; both methods coexist
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