Developer guide · WebAuthn

Passkey authentication for developers

Passkeys replace reusable passwords with public-key credentials bound to a real website or application. Here is what the browser handles, what your authentication server must still own, and how to add the flow without building the whole identity stack.

Passkey authentication is a phishing-resistant sign-in method built on WebAuthn. A device creates a unique public/private key pair for your relying party. Your server stores the public credential; the private key stays with the user’s authenticator and is unlocked with the device’s normal gesture, PIN or biometrics.

The useful mental model

A passkey is not a password placed in a different vault. It is a scoped cryptographic credential that proves possession without sending a reusable secret to your server.

How passkey authentication works

WebAuthn coordinates the browser, the authenticator and your server. The browser enforces the relying-party origin. The authenticator creates or uses a private key. The server issues short-lived challenges, verifies the signed response and decides which application identity the credential belongs to.

Registration

  1. Your application starts registration for an authenticated or explicitly invited user.
  2. The server creates a random, single-use challenge and returns WebAuthn creation options.
  3. The browser asks an authenticator to create a credential scoped to the relying-party ID.
  4. The server verifies the origin, challenge, attestation data and user binding before storing the public credential.

Sign-in

  1. The server creates another short-lived challenge and returns request options.
  2. The authenticator signs the challenge for the correct relying party after local user verification.
  3. The server checks the signature, origin, challenge, counter policy and credential state.
  4. A successful assertion becomes a revocable application session or a narrowly scoped downstream token.

What a passkey server still has to do

Browser APIs cover only the client ceremony. A production authentication service still needs durable identity records, challenge expiry, single-use enforcement, credential lifecycle management, secure sessions, signing keys, audit events, backups and operational recovery. These details are where a small demo becomes a security boundary.

  • Bind every challenge: to the intended user, relying party, operation and short expiry window.
  • Verify the real origin: do not accept a client-supplied origin or relying-party identifier.
  • Store public material safely: credentials are not passwords, but identity records and sessions remain sensitive.
  • Design recovery explicitly: lost-device recovery can weaken an otherwise phishing-resistant flow.
  • Keep authorization separate: authentication proves an identity; your application still owns roles, entitlements and resources.

Passkeys compared with common sign-in methods

MethodReusable secretOrigin boundServer workload
PasswordYesNoHashing, resets, breach defence and often MFA
Email magic linkNo app passwordUsually noDelivery, token expiry and mailbox dependency
Passkey / WebAuthnNoYesCeremony verification, credentials, sessions and recovery

How RustyAuth packages the boundary

RustyAuth is an open-source, passkey-first authentication service written in Rust. It handles registration and authentication ceremonies, multiple credentials per user, HttpOnly revocable sessions, short-lived ES256 access tokens, public JWKS, signing-key rotation, ordered events and verified backups. Identity state lives in a private, volume-backed SableDB instance.

You can run one isolated realm in your own cloud, deploy it into customer-controlled infrastructure, or operate it inside a disconnected environment. Your application remains responsible for authorization and business policy. See the architecture boundary and thesecurity model before adopting it.

Try passkey authentication locally

git clone https://github.com/rusty-auth/rustyauth.git
cd rustyauth
scripts/local-stack standalone up

The launcher generates private development secrets and starts the Dioxus dashboard, Rust backend and private SableDB service. Continue with the complete quickstart andrelying-party integration guide.

A note on production readiness

RustyAuth 0.1.0 is a pre-release. Account recovery, broader abuse controls, multi-writer qualification and an independent security assessment remain work before 1.0. Thestatus and roadmap separates implemented behaviour from product direction.

Try the complete boundary

Run passkey authentication locally.

Start locally