Skip to content

Passkeys as an optional sign-in method #116

Description

@pataniaeli

Ticket: AUTH-T105 · Epic: E3 Authentication Core · Phase: Phase 4 — Aplio, SenatePath, retention
Priority: Medium · Estimate: 5 points · Labels: epic:auth-core, phase:4, backend, frontend, security, better-auth

Depends on:

Suggested by Benedikt and accepted: add the Better Auth passkey plugin (WebAuthn) as an optional, per-user sign-in method. Passkeys cost no email, resist phishing, and suit students who prefer not to manage passwords.

  • Enrollment from /account/security after fresh re-auth (AUTH-T32); users may register several passkeys and name/remove them. Relying-party ID is auth.northeasternsga.com (dev: auth-dev.northeasternsga.com), so passkeys are only usable on SGAuth's own login page; products never see WebAuthn.
  • Sign-in: the login page offers 'Sign in with a passkey' alongside email + password, including conditional UI (browser autofill) where supported. A successful passkey sign-in creates the same parent-domain session as a password sign-in.
  • Password stays as the account's fallback and for recovery; passkeys do not replace the password in v1.
  • MFA: a passkey does not satisfy the admin TOTP requirement in v1 (admins still enroll TOTP); revisit later.
  • Lockout counters (AUTH-T64) are unaffected by passkey attempts; failed WebAuthn ceremonies are rate-limited (AUTH-T63).
  • Schema: plugin's Passkey table via Prisma; audit PASSKEY_ADDED / PASSKEY_REMOVED / LOGIN_SUCCESS with method=passkey.
  • Tombstoning (AUTH-T78) and admin deactivation remove passkeys.

Acceptance criteria

  • A user can enroll a passkey after re-auth, sign out, and sign back in with the passkey in Chrome, Safari, and Firefox (platform authenticator and a security key).
  • A passkey sign-in yields a session that products resolve exactly like a password sign-in (session endpoint contract test).
  • Removing a passkey or deactivating the user prevents its further use; audit events are emitted.
  • An admin who signs in with a passkey is still required to have TOTP enrolled for admin actions.

Generated from the SGAuth design (docs/sgauth-design in SGAOperations/auth). SGAuth is built on Neon and does not use Supabase.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions