Prompt

How do I let users sign in with a passkey on web and mobile?

Technology / Identity & Access1 observationLast seen Oct 28, 2026

Latest observation

Oct 28, 2026OpenAI APIWeb search: off

To let users sign in with a passkey on web and mobile, you typically use WebAuthn / Passkeys APIs on the web and the platform credential managers on mobile, all backed by the same server-side auth flow.

1) High-level architecture

You need:

  • Server
    • Issues challenges
    • Verifies passkey responses
    • Stores credential public keys and metadata
  • Web app
    • Uses WebAuthn
  • Mobile app
    • Uses platform passkey APIs
      • iOS: AuthenticationServices
      • Android: Credential Manager / FIDO2

Passkeys are based on public-key cryptography, so your server never stores a password. It stores:

  • user ID
  • credential ID
  • public key
  • sign count / metadata

2) Two main flows

Registration

User creates a passkey for your account.

  1. Server creates a registration challenge
  2. Client calls passkey creation API
  3. Authenticator/user verifies with biometrics/device lock
  4. Client sends result back to server
  5. Server verifies and stores the public key

Authentication

User signs in with an existing passkey.

  1. Server creates an authentication challenge
  2. Client calls passkey assertion/sign-in API
  3. Authenticator verifies user
  4. Client sends signed assertion to server
  5. Server verifies signature and logs user in

3) Web implementation

Use WebAuthn in browsers.

Registration on web

const options = await fetch('/auth/register/options', { method: 'POST' }).then(r => r.json());

options.challenge = base64urlToBuffer(options.challenge);
options.user.id = base64urlToBuffer(options.user.id);
options.excludeCredentials = options.excludeCredentials?.map(c => ({
  ...c,
  id: base64urlToBuffer(c.id),
}));

const credential = await navigator.credentials.create({
  publicKey: options
});

await fetch('/auth/register/verify', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(credential)
});

Authentication on web

const options = await fetch('/auth/login/options', { method: 'POST' }).then(r => r.json());

options.challenge = base64urlToBuffer(options.challenge);
options.allowCredentials = options.allowCredentials?.map(c => ({
  ...c,
  id: base64urlToBuffer(c.id),
}));

const assertion = await navigator.credentials.get({
  publicKey: options
});

await fetch('/auth/login/verify', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify(assertion)
});

Important:

  • Passkeys require HTTPS
  • Your domain must be correctly configured
  • Use origin/RP ID validation on the server

4) iOS implementation

Use AuthenticationServices.

Sign up / create passkey

  • ASAuthorizationPlatformPublicKeyCredentialProvider
  • ASAuthorizationController

Sign in

  • ASAuthorizationPlatformPublicKeyCredentialProvider
  • ASAuthorizationController

Typical flow:

  1. Fetch challenge/options from your backend
  2. Build a request using Apple APIs
  3. Present authorization controller
  4. Send attestation/assertion data back to backend for verification

Apple supports passkeys synced via iCloud Keychain.


5) Android implementation

Use Credential Manager for passkeys.

Sign up

  • Create a CreatePublicKeyCredentialRequest
  • Request passkey creation

Sign in

  • Create a GetPublicKeyCredentialOption
  • Request a passkey assertion

Flow:

  1. Get challenge/options from backend
  2. Call Credential Manager
  3. Send returned credential data to backend
  4. Backend verifies response

Credential Manager is the recommended modern API.


6) Backend requirements

Your backend should implement:

Challenge endpoints

  • POST /auth/register/options
  • POST /auth/register/verify
  • POST /auth/login/options
  • POST /auth/login/verify

Verification steps

For both registration and login:

  • Check challenge matches what you issued
  • Check origin / RP ID
  • Check signature is valid
  • Check user and credential binding
  • Check sign counter if applicable

Store

  • userId
  • credentialId
  • publicKey
  • transports
  • signCount
  • createdAt

7) Cross-platform strategy

If you want the same account to work on web and mobile:

  • Use the same backend passkey system
  • Use the same user IDs
  • Let users create one or more passkeys per account
  • Support discovery login:
    • User enters email or username, or
    • User uses “Sign in with a passkey” and the authenticator discovers the account

Recommended UX:

  • “Continue with passkey”
  • Fallbacks:
    • email magic link
    • password
    • recovery codes
    • support-based recovery

8) Libraries you can use

Web / Node

  • @simplewebauthn/server
  • @simplewebauthn/browser

Server-side

  • fido2-lib
  • WebAuthn libraries in your backend language

Mobile

  • iOS: native AuthenticationServices
  • Android: native Credential Manager APIs

9) Security best practices

  • Use HTTPS everywhere
  • Verify origin and RP ID strictly
  • Use a short-lived, single-use challenge
  • Store challenges server-side or signed
  • Allow credential registration only after authenticated session or email verification
  • Provide account recovery options
  • Support multiple passkeys per account
  • Keep passkey login as the primary path, but don’t trap users with no recovery

10) Recommended implementation plan

  1. Add server challenge/verify endpoints
  2. Add WebAuthn to your web app
  3. Add iOS passkey support
  4. Add Android Credential Manager support
  5. Normalize credential storage on the backend
  6. Add UX for:
    • create passkey
    • sign in with passkey
    • manage/delete passkeys
    • recover account

If you want, I can give you:

  1. a complete backend example in Node/Express,
  2. a web implementation using SimpleWebAuthn, or
  3. iOS + Android sample code for passkey sign-in.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.