Skip to content

Authentication: one-time codes, passkeys, bot protection, SAML #6

Open

Description

@fgatti675

Guiding rule for this phase: every capability ships as an open-source interface with a working zero-configuration default. Hosted infrastructure is a different implementation behind that same interface — never the only implementation, and never a different API.

Authentication ships OAuth across twelve providers, magic link, anonymous sign-in, TOTP multi-factor, asymmetric keys and scoped API keys. The methods below are the remaining ones, and each unlocks a category of application that cannot currently be built.

All of them are credentials plus an HTTP call, so they behave identically self-hosted and hosted.

Work

  • Phone / SMS one-time codes, behind an SmsProvider interface with a development sink default
  • Email one-time codes (six digits) alongside magic link, for devices where opening a link is not practical
  • Bot protection on sign-up, sign-in and password reset — hCaptcha and Cloudflare Turnstile
  • Passkeys / WebAuthn. The translation strings already exist across the locales and in packages/admin-types; the implementation does not
  • SAML 2.0 and SCIM, for organisations that provision users from a directory

Sequencing

If enterprise customers are a near-term goal, SAML and SCIM move to the front of this list; otherwise they follow passkeys.

Activity

  1. added
    enhancement
    roadmap
    on Aug 21, 2026
  2. fgatti675 commented on Aug 25, 2026

    @fgatti675
    MemberAuthor

    Email one-time codes are done. auth.emailOtp: true, or AUTH_EMAIL_OTP=true:

    POST /auth/otp          { email }        → always 200
    POST /auth/otp/verify   { email, code }  → a session
    

    rebase.auth.sendEmailOtp(email) / verifyEmailOtp(email, code) in the client, and emailOtp joins the capability document — the wire-contract test caught its absence, which is what it is for.

    Six digits is a million possibilities, which is nothing to a machine, so the shape is what makes it safe. Each of these is load-bearing and separately tested:

    • the code is bound to the address. What is stored is a hash of otp:<email>:<code>, so verify needs both halves. A lookup keyed on the code alone would have made every account in the table a target of the same million guesses; this way a guess is a guess against one named account;
    • five verification attempts per address per window, keyed on the address rather than the IP — the reasoning mfaVerificationLimiter already uses: an IP is the attacker's to rotate and the account under attack is not. Counts live in whatever store the deployment configured, so REBASE_RATE_LIMIT_STORE=sql makes the limit shared rather than per replica;
    • ten minutes, single use, and uniform digits from randomInt rather than a modulo of random bytes;
    • POST /auth/otp answers identically for an address with no account, so it is not an oracle for "is this person a customer?".

    It reuses the magic-link token store rather than adding a table. A code and a link token are the same object — a hashed secret for one account, with an expiry and a used flag — so there is no schema change, no second cleanup path, and no second place for "was this already used?" to be answered differently.

    AUTH_MAGIC_LINK arrives with it. Both flows were code-level flags only, so a bundle deployment — which is what every self-hosted and managed project runs — could not turn either on without rebuilding. Whether a deployment wants passwordless login is a property of the deployment.

    Phone / SMS was deliberately not started, and the reason is worth recording here rather than discovering later. It is not the SmsProvider interface that is missing — that part is an afternoon. It is that auth has no phone identity at all: no column on the user, no lookup, no answer to how a number gets attached and proved. Adding one is an auth-schema change across three drivers plus an AUTH_SCHEMA_VERSION stamp, and a set of product decisions (self-service or admin-set? does a phone log you in, or only step up a session that already exists?). Building the provider interface first would have left an abstraction with no consumer, which is the shape of a marker that looks implemented and never worked. It deserves its own issue.

    Passkeys have the same shape — a credentials table, an auth-schema change — and the translation strings that already exist across the locales are not evidence to the contrary.

    Landed on main locally and not pushed — pushing to main publishes a canary, which is yours to trigger.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementroadmap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions