mirror of
https://github.com/better-auth/better-auth.git
synced 2026-10-19 11:24:57 -05:00
A confidential client with inline `jwks` can now replace its keys at `POST /oauth2/client/rotate-keys` without a user session. The request carries the complete new JWK Set and a client assertion signed by a current key, addressed to the rotation endpoint itself, so an assertion minted for the token endpoint or the issuer cannot be redirected here. Enabled with `allowClientKeyRotation`. Keys left out of the new set stop verifying at once. A client rolls a key in two steps, the way a jwks_uri client does: it sends the old and new keys together, then drops the old key once every instance signs with the new one. Only current keys can authorize a rotation, matching RFC 7592, node-oidc-provider, Ory Hydra, and Keycloak, where only the current management credential can change a client. The write is guarded on the exact key set the assertion was verified against, so a concurrent rotation fails with 409 instead of overwriting. No schema change is needed.
Website & Docs
The main website and documentation for better-auth.com
Quick Start
# install
pnpm install
# develop
pnpm dev
Open localhost:3000 to preview.
Stack
- Framework: Next.js 16 (App Router, Turbopack)
- Styling: Tailwind CSS 4
- Animation: Framer Motion
- Docs: Fumadocs
- Icons: Lucide React
- Fonts: Geist Sans & Geist Mono
Structure
├─ app/
│ ├─ page.tsx # Home — hero + sign-in demo
│ ├─ products/ # Products page
│ ├─ blog/ # Blog posts
│ └─ docs/[[...slug]]/ # Documentation (MDX)
│
├─ components/
│ ├─ landing/ # Marketing components
│ ├─ docs/ # Documentation components
│ ├─ ui/ # Shared primitives
│ └─ icons/ # Brand icons & logo
│
├─ content/ # MDX documentation files
│
├─ lib/
│ ├─ source.ts # Fumadocs content source
│ └─ utils.ts # Utilities
│
└─ public/
└─ branding/ # Logo assets (SVG + PNG)
Scripts
pnpm dev # Start dev server (Turbopack)
pnpm build # Production build
pnpm start # Serve production build
pnpm lint:fix # Lint & auto-fix with Biome