-
Notifications
You must be signed in to change notification settings - Fork 0
Local Keycloak dev instance for auth development #183
Copy link
Copy link
Open
Labels
developmentNew features or functionality implementationNew features or functionality implementationdevopsCI/CD, deployment, infrastructure, or tooling workCI/CD, deployment, infrastructure, or tooling worksmartem-backend:apiREST API endpoints and HTTP interface changesREST API endpoints and HTTP interface changessmartem-frontendUser-facing web UI for acquisition sessions and ML decisionsUser-facing web UI for acquisition sessions and ML decisions
Metadata
Metadata
Assignees
Labels
developmentNew features or functionality implementationNew features or functionality implementationdevopsCI/CD, deployment, infrastructure, or tooling workCI/CD, deployment, infrastructure, or tooling worksmartem-backend:apiREST API endpoints and HTTP interface changesREST API endpoints and HTTP interface changessmartem-frontendUser-facing web UI for acquisition sessions and ML decisionsUser-facing web UI for acquisition sessions and ML decisions
Overview
Keycloak at
identity.diamond.ac.ukrequires VPN access, which is inconvenient for local development. We need a local Keycloak instance that both the frontend and backend can use during development.Proposed approach
Run Keycloak in Docker using its
start-devmode (in-memory H2 database, instant startup):What's needed
Realm export JSON — checked into devtools (or mounted as a volume) so setup is reproducible. Should include:
smartemrealm (or whatever matches production)smartem-frontendpublic client (SPA, no secret)http://localhost:5174/*)Frontend config —
VITE_KEYCLOAK_URL=http://localhost:8080in.env.development.local. The auth infrastructure already supports this (PR Add app config #74 in smartem-frontend).Backend config — when backend token validation is added, it needs the same Keycloak URL for JWKS discovery. The local instance's
/.well-known/openid-configurationendpoint provides everything needed for offline JWT verification.Developer documentation — how-to guide in devtools docs for setting up local auth.
Integration points
keycloak-jsconnects to local instance, gets real tokens, full OAuth redirect flow worksAlternatives considered
Acceptance criteria