Skip to content

Rebuild oidc-spa tutorial starter on Vite and React 19 - #31

Closed
Wictorgirardi wants to merge 2 commits into
p2-inc:mainfrom
Wictorgirardi:feat/react-oidc-spa-starter
Closed

Wictorgirardi wants to merge 2 commits into
p2-inc:mainfrom
Wictorgirardi:feat/react-oidc-spa-starter

Conversation

@Wictorgirardi

@Wictorgirardi Wictorgirardi commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #28: this branch includes its commit, so review the last commit only until #28 is merged. It pairs with #30 (oidc-spa example).

Summary

The blog post Securing Keycloak with OIDC SPA and Phase Two links here as its starting point.

  • What it is now: exactly the oidc-spa example from Migrate React oidc-spa example to Vite, React 19 and oidc-spa 10 #30 minus the authentication code. Same Vite 8 / React 19 / TypeScript 6 / Tailwind 4 scaffold, same layout and assets, with .env already pointing at the demo realm. It used to be a CRA copy.
  • src/Auth.tsx: a clear placeholder. Before, it was a stub that wasn't even exported.
  • README: replaced the text copied from the oidc-client-ts example with the tutorial steps for oidc-spa 10:
    • pnpm add oidc-spa zod, then src/oidc.ts;
    • the Vite plugin;
    • the OidcInitializationGate;
    • the Auth.tsx component.
  • Workflow: new CI-only workflow. The starter has no deployment.

Test plan

  • pnpm install --frozen-lockfile && pnpm typecheck && pnpm lint && pnpm build pass on Node 24.
  • diff -r against Migrate React oidc-spa example to Vite, React 19 and oidc-spa 10 #30 shows only the auth files, vercel.json, dependencies and titles.
  • Applied the README's tutorial steps to a copy of the starter: it typechecks, builds, and logs in and out against the local Keycloak.

@Wictorgirardi

Copy link
Copy Markdown
Contributor Author

Combined into #44 with the other SPA examples. The changes are the same; only the commit SHAs differ.

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