Prompt
How do I let users sign in with passkeys on web and mobile?
Latest observation
Oct 28, 2026
OpenAI APIWeb search: off
To let users sign in with passkeys on web and mobile, you typically implement WebAuthn / FIDO2 on the backend and use the platform passkey APIs on each client.
1) What passkeys are
Passkeys are based on:
- WebAuthn for browser and many native-app flows
- FIDO2 / CTAP underneath
- Device biometrics / PIN / screen lock to unlock the private key
They let users sign in with:
- Face ID / Touch ID / fingerprint
- Device PIN / pattern
- Cross-device passkey use via synced credentials
2) Basic architecture
You need:
- Backend auth server
- Creates registration and login challenges
- Verifies signatures
- Stores public keys and credential metadata
- Web client
- Uses browser WebAuthn APIs
- Mobile app
- Uses platform APIs:
- iOS: AuthenticationServices
- Android: Credential Manager / passkeys APIs
- Uses platform APIs:
3) Core flows
A. Registration / enrollment
- User starts “Create passkey”
- Server generates a registration challenge
- Client calls platform authenticator API
- User approves with biometrics/PIN
- Authenticator creates a new key pair
- Client sends the result to the server
- Server verifies and stores:
- credential ID
- public key
- sign count / device metadata if relevant
- user ID association
B. Login / authentication
- User selects “Sign in with passkey”
- Server generates an assertion challenge
- Client asks authenticator to sign it
- User approves with biometrics/PIN
- Client returns signed assertion
- Server verifies signature using stored public key
- If valid, issue session / JWT / cookie
4) Web implementation
On the web, use:
navigator.credentials.create()for registrationnavigator.credentials.get()for sign-in
You must send to the server:
PublicKeyCredentialCreationOptionsfor registrationPublicKeyCredentialRequestOptionsfor login
Important server-side tasks:
- Generate cryptographically random challenges
- Verify:
- challenge
- origin
- rpId
- signature
- user handle / user verification flags
- Prevent replay by invalidating used challenges
5) Mobile implementation
iOS
Use:
ASAuthorizationPlatformPublicKeyCredentialProviderASAuthorizationController
You’ll generally:
- Request registration or assertion options from your backend
- Convert them into Apple’s API objects
- Receive a credential response
- Send it back to your backend for verification
Android
Use:
- Credential Manager
- Passkeys via Google Play services / platform support
Typical flow:
- Get options from backend
- Call Credential Manager to create/get passkeys
- Return response to backend
6) Recommended UX
Good passkey UX usually includes:
- “Sign in with passkey”
- “Create a passkey” after password sign-in or during onboarding
- Fallback options:
- email magic link
- password
- recovery codes
- support flow
Also:
- Let users add multiple passkeys
- Label them by device if possible
- Allow removal/revocation
7) Important security requirements
- Always use HTTPS
- Verify origin and RP ID on web
- Use short-lived, single-use challenges
- Store only public keys, never private keys
- Tie credentials to a user account securely
- Support account recovery in case a user loses all devices
- Use user verification when appropriate
8) Libraries that help
You can implement directly, but many teams use libraries:
- Web
@simplewebauthn/browser@simplewebauthn/server
- Server
- SimpleWebAuthn
webauthn4jfido2-lib
- iOS / Android
- Native platform SDKs, often with shared backend logic
9) Practical rollout plan
A common approach:
- Add WebAuthn backend support
- Add “create passkey” on web
- Add “sign in with passkey” on web
- Add iOS passkey support
- Add Android passkey support
- Add account linking, recovery, and device management UI
10) If you want the shortest possible implementation path
Use:
- WebAuthn on backend
- SimpleWebAuthn for web/server
- Native passkey APIs on iOS/Android
- A shared challenge/verification service
If you want, I can also give you:
- a full backend + frontend code example,
- an iOS + Android implementation outline, or
- a step-by-step production architecture.