UI: Add OIDC login flow to frontend #40

Closed
opened 2026-03-14 12:38:38 +01:00 by claude · 1 comment
Owner

Context

The backend OIDC token exchange is implemented (a4de2a7). The SPA needs to support the OIDC authorization code flow alongside the existing local login.

Requirements

  • On the login page, show an "SSO Login" button when OIDC is enabled (check GET /api/v1/auth/oidc/config — returns 404 if disabled)
  • Clicking SSO redirects to the OIDC provider's authorization endpoint with response_type=code, client_id, redirect_uri, and scope=openid email profile
  • After redirect back, extract the code from URL params and POST /api/v1/auth/oidc/callback with { code, redirectUri }
  • Store the returned accessToken/refreshToken the same way as local login
  • Keep local login as fallback (always visible)

Notes

  • The /auth/oidc/config endpoint returns { issuer, clientId, authorizationEndpoint } — everything the SPA needs to build the redirect URL
  • No OIDC library needed in the SPA — it's just a redirect + code exchange
## Context The backend OIDC token exchange is implemented (a4de2a7). The SPA needs to support the OIDC authorization code flow alongside the existing local login. ## Requirements - On the login page, show an "SSO Login" button when OIDC is enabled (check `GET /api/v1/auth/oidc/config` — returns 404 if disabled) - Clicking SSO redirects to the OIDC provider's authorization endpoint with `response_type=code`, `client_id`, `redirect_uri`, and `scope=openid email profile` - After redirect back, extract the `code` from URL params and `POST /api/v1/auth/oidc/callback` with `{ code, redirectUri }` - Store the returned `accessToken`/`refreshToken` the same way as local login - Keep local login as fallback (always visible) ## Notes - The `/auth/oidc/config` endpoint returns `{ issuer, clientId, authorizationEndpoint }` — everything the SPA needs to build the redirect URL - No OIDC library needed in the SPA — it's just a redirect + code exchange
Author
Owner

Already implemented: OidcCallback.tsx, OIDC flow in LoginPage.tsx, /oidc/callback route in router.

Already implemented: `OidcCallback.tsx`, OIDC flow in `LoginPage.tsx`, `/oidc/callback` route in router.
Sign in to join this conversation.