feat(web): OIDC sign-in and local dev identity provider (#39) #122
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/kws!122
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/39-oidc-login"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Slice 2 of the ticket storefront (#39): sign-in and sign-out with OIDC authorization code + PKCE, built and tried against a local dev identity provider. Design
docs/superpowers/specs/2026-10-29-storefront-login-design.md, plandocs/superpowers/plans/2026-10-29-storefront-login.md. No change underapi/, no OpenAPI change, no migration.What it does
navikt/mock-oauth2-server6.1.4 indeploy/compose.dev.yml, host port 8883 (bound to 127.0.0.1), issuerhttp://localhost:8883/default, access tokens getaud=kws-api.make upstarts it. Users are typed at its login form (claims snippets indeploy/dev-idp/README.md); the mock has no user list.web/apps/ticket:oidc-client-ts(exact version),AuthProvider/useAuth,/auth/callback, header Sign in / name + Sign out, account name fromGET /v1/me, bearer token on API calls. Token in memory only; PKCE state insessionStorageduring the redirect. Auth is off whenVITE_OIDC_AUTHORITYis unset (production build, CI e2e): the public site is slice 1.//, schemes, backslashes, control characters, the callback path are refused), code exchanged once under StrictMode, callback URL cleaned from history, fixed error text only (no IdP text, tokens or codes shown or logged), sign-out drops the stored user first so the id token is not in the end-session URL,strict-originreferrer policy.pnpm --filter @kws/ticket e2e:idp(not inpnpm testor CI).Verification
pnpm typecheck,pnpm test(142),pnpm buildgreen; standard Playwright e2e in Playwright's image: 104 passed / 46 skipped by design./v1/me, nothing inlocalStorage/sessionStorage/URL, sign out, 320 px header signed in and out). Also shown in a headless browser round trip.make cover: 91.3% (minimum 80%; Go code unchanged).Author calls (owner to check)
VITE_OIDC_SCOPE/VITE_OIDC_AUDIENCEwere dropped (YAGNI); add them when Zitadel needs an audience scope.reuseExistingServeris now false inplaywright.config.ts, so a runningpnpm dev(auth on) cannot leak into the standard e2e.Not verified
client_id-only end-session logout may show a confirm page); production CORS from the SPA to the IdP.:has()is used in the phone header CSS)./v1/me(an expired token keeps the header showing the name until/v1/merefetches); the client-wideonResponsehandler is deferred to #40.Refs #39 (does not close it).
🤖 Generated with Claude Code