Passwordless login, built by hand
Magic links, passkeys and sessions on our own identity provider, replacing AWS Cognito.
DataData ModelSections
Data Model
Design notes from each story. Tables belong to the owning service only.
- IDENTITY-V2-E8-01 · Identity schema and session service
- New in
identity:auth_identities,login_tokens,passkeys,recovery_codesas listed in AC1.identity.sessions(from IDENTITY-V1-E1-03) gains last_seen_at, absolute_expires_at, ip_hash, user_agent, reauthenticated_at.identity.users.cognito_subbecomes nullable. - IDENTITY-V2-E8-02 · Magic link sign-in and sign-up
- Uses
identity.login_tokens(purposemagic_link).identity.rate_limits(key, window_start, count; primary key (key, window_start)) backs the per-email and per-IP limits. - IDENTITY-V2-E8-03 · Email one-time code fallback
identity.login_tokensadds code_hash, attempts (purposeemail_code).- IDENTITY-V2-E8-04 · Passkeys: register and sign in
- Uses
identity.passkeys; adds backed_up boolean, backup_eligible boolean.identity.webauthn_challenges(id, user_id null, challenge, purpose, expires_at). - IDENTITY-V2-E8-05 · Recovery codes
- Uses
identity.recovery_codes; a regenerate deletes the user's old rows in the same transaction. - IDENTITY-V2-E8-06 · Session management page
- No schema change; reads
identity.sessions. - IDENTITY-V2-E8-07 · Re-authentication for sensitive actions
identity.sessions.reauthenticated_at.identity.email_changes(id, user_id, new_email, token_hash, expires_at, confirmed_at).- IDENTITY-V2-E8-08 · Cognito migration and shutdown
identity.usersadds migrated_at. After cutoff, a migration dropscognito_sub.- IDENTITY-V2-E8-09 · Auth security hardening
- No schema change.
- IDENTITY-V2-E8-10 · Account security on our own screens
- No schema change.
- IDENTITY-V2-E8-11 · Deactivate first, delete after 30 days
identity.usersaddsdeactivated_atanddeletes_at(both empty unless deactivated). A partial index ondeletes_atserves the daily job.- IDENTITY-V2-E8-12 · Rotate service client secrets without downtime
identity.service_client_secrets(id, client_id → service_clients, secret_hash unique, created_at, last_used_at, retired_at), replacingservice_clients.secret_hash. A partial unique rule allows at most two active secrets per client.
Coming Soon...
The entities, their relationships, what every field means and the business rules will appear here when this module's design is finalized.