Skip to content

[Auth] Implement ADR-0069 — enterprise authentication hardening (P1/P2/P3) #2281

Description

@os-zhuang

Tracking issue for implementing ADR-0069: Enterprise authentication hardening (merged in #2275). Design is accepted-in-principle; no code yet — this issue tracks the phased build.

Parent: #2246 (first-run admin experience). Governing constraint: ADR-0049 — every setting ships with its runtime enforcement; no "false surface" toggles.

Each item = (setting → enforcement seam → mechanism). [native] = better-auth 1.6.x knob; [custom] = ObjectStack hook/middleware; [field] = new identity column.

P1 — security floor (first real customers)

P2 — defense in depth

  • Session controls [custom][field] — idle timeout, absolute max, concurrent cap; fields sys_session.last_activity_at, revoked_at, revoke_reason.
  • IP allowlist [custom][field]sys_organization.allowed_ip_ranges (+ optional per-user); Hono auth-route middleware before the better-auth handler.
  • OIDC trust-list UI [native] — surface admin-managed OIDC providers (issuer/client/scopes/allowed domains) instead of env-only genericOAuth.

P3 — federation breadth

  • SAML 2.0not in better-auth core; assess @better-auth/sso vs custom plugin. Do not ship a SAML settings surface before an enforcing impl (ADR-0049).
  • Broader settings-driven social providers; per-org override UI polish.

Out of scope (separate issues/ADRs)

  • SCIM / directory provisioning & bulk import (separate ADR — provisioning ≠ auth).
  • Passkeys / WebAuthn.

Suggested first PR: haveibeenpwned (native, low-risk) as the enforcement-wired pattern template, then the [custom] items each with their hook + tests.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions