Launch offer for the first 500 accounts: $10K MTR free for 24 months + $100 credit →
    .io

    Passkeys

    A first factor with nothing to phish

    A passkey is a key pair bound to your origin. The private half never leaves the user's device, there is no shared secret to breach, and it cannot be handed to a convincing lookalike site — the browser refuses to use it on the wrong origin. BillDog implements the standard WebAuthn ceremonies with server-issued challenges.

    Registering one

    The user must already be signed in — a passkey is added to an existing account, not used to create one.

    Code
    const { credentialId } = await auth.registerPasskey('MacBook Pro');

    The label is for the user's own account screen, so they can tell two devices apart later. Registering runs the full ceremony: the server issues a challenge, the browser prompts for Face ID, Touch ID, Windows Hello or a security key, and the resulting public key is stored against the user.

    Passkeys already on an account are not listed and cannot be removed through this SDK. The endpoint has four actions — the two register legs and the two sign-in legs — and none of them enumerates or deletes, so a list here would be invented rather than read.

    Signing in

    Code
    const result = await auth.signInWithPasskey();
    
    // The same three-state answer every sign-in method returns: check this
    // BEFORE reading result.session, which is null while a factor is owed.
    if (result.mfaRequired) {
      const done = await auth.attempt({
        strategy: 'totp',            // or 'backup_code'
        code: authenticatorCode,
        mfaToken: result.mfaToken,   // no identifier — the token names the account
      });
      use(done.session);
    } else {
      use(result.session);
    }

    One call, no identifier needed — the browser offers the user whichever passkeys it holds for your origin. This is a complete first factor, so on an account with no second factor enrolled the answer carries the session and mfaRequired is false. It returns the same AttemptResult as attempt rather than a bare session, so that a server which does answer a passkey with a challenge surfaces here instead of being applied as a null session.

    On native platforms

    iOS and Android expose BillDogPasskeys alongside the auth module, and the React Native, Expo and Flutter bridges expose passkeysAvailable(), registerPasskey() and signInWithPasskey().

    Practical advice

    • Offer passkeys in addition to another method, not instead of one. A user who loses every device holding a passkey needs some other way in.
    • Prompt to register after a successful sign-in, not during sign-up — people say no to a system prompt they did not expect.
    • Label every passkey at registration. It is the only chance — nothing in the API reads the label back, so an unlabelled credential is one nobody can ever identify.
    • A passkey is bound to your origin. Moving your sign-in page to a different domain invalidates every passkey registered on the old one.

    Was this page helpful?

    Or rate this page:

    We use cookies and process your data to provide our services. By continuing, you agree to our Terms and Privacy Policy.