Skip to content

docs(adr): ADR-0069 enterprise authentication hardening#2275

Merged
os-zhuang merged 1 commit into
mainfrom
docs/adr-enterprise-auth-hardening
Jun 24, 2026
Merged

docs(adr): ADR-0069 enterprise authentication hardening#2275
os-zhuang merged 1 commit into
mainfrom
docs/adr-enterprise-auth-hardening

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

Adds ADR-0069: Enterprise authentication hardening — the design for taking the auth settings surface from "demo-grade" (10 fields: email/password, signup, verify, password min/max, session expiry/refresh, Google) to "enterprise security-review-grade".

Why now

Dogfooding the Setup app as a new system administrator (#2246) showed a real company can't enable the platform without a password policy, enforced MFA, SSO beyond Google, session controls, IP gating, and brute-force protection. This ADR specifies that end-state.

The discipline

Per ADR-0049 (no unenforced security properties), every capability is written as a (setting → enforcement seam → mechanism) triple — no field is proposed without the runtime code path that enforces it. It explicitly separates:

  • better-auth-native knobs (1.6.x): core rateLimit, haveibeenpwned breached-password, twoFactor, genericOAuth/oidcProvider, session expiresIn/updateAge/freshAge.
  • custom hooks/middleware + new identity fields: password complexity/expiry/history, account lockout, org-wide MFA requirement, idle/absolute/concurrent sessions, IP allowlist.

SAML is called out as not in better-auth core → scoped P3/external (don't ship a SAML settings surface before an enforcing implementation exists — that would itself violate ADR-0049). SCIM/bulk-provisioning is deferred to a separate ADR.

Grounded in a read of plugin-auth (better-auth wiring, bindAuthSettings/applyConfigPatch), auth.manifest.ts, and the identity objects. Phased P1/P2/P3.

Docs-only (Status: Proposed) → skip-changeset. Relates to #2246.

Proposes the target end-state for the auth settings surface (password policy,
enforced MFA, SSO/OIDC, session controls, IP allowlist, anti-brute-force),
each capability specified as a (setting -> enforcement seam -> mechanism)
triple per ADR-0049 (no unenforced security properties). Distinguishes
better-auth-native knobs (rateLimit, haveibeenpwned, twoFactor, genericOAuth,
session windows) from the custom hooks/middleware + identity fields needed for
complexity/expiry/history, account lockout, org-wide MFA requirement, idle/
absolute/concurrent sessions, and IP gating. SAML scoped P3/external (not in
better-auth core). Phased P1/P2/P3; SCIM deferred to a separate ADR.

Grounded in a read of plugin-auth (better-auth 1.6.x wiring) + auth.manifest +
identity objects. Relates to #2246.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@os-zhuang os-zhuang added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Jun 24, 2026
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jun 24, 2026 8:17am

Request Review

@os-zhuang
os-zhuang merged commit 99d41b5 into main Jun 24, 2026
8 of 9 checks passed
@os-zhuang
os-zhuang deleted the docs/adr-enterprise-auth-hardening branch June 24, 2026 08:17
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation labels Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant