Prompt

passkeys for web app

Technology / Identity & Access1 observationLast seen Oct 28, 2026

Latest observation

Oct 28, 2026OpenAI APIWeb search: off

If you want to add passkeys to a web app, the modern approach is to use WebAuthn (FIDO2) on the frontend and a server-side registration/login flow.

What passkeys are

Passkeys let users sign in with:

  • Face ID / Touch ID / Windows Hello / Android biometrics
  • Device PIN
  • Security keys

They replace passwords and are phishing-resistant.


Basic flow

1) Registration

  1. User signs up or chooses “Create passkey”
  2. Server creates a WebAuthn registration options challenge
  3. Browser calls navigator.credentials.create(...)
  4. Browser returns credential data
  5. Server verifies it and stores:
    • credential ID
    • public key
    • sign counter
    • user handle

2) Login

  1. User clicks “Sign in with passkey”
  2. Server creates a WebAuthn authentication options challenge
  3. Browser calls navigator.credentials.get(...)
  4. Browser returns assertion data
  5. Server verifies signature using stored public key

Frontend APIs

Registration

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

Authentication

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

What your server must do

Your backend should:

  • generate a cryptographically random challenge
  • store it temporarily in session/cache
  • verify origin, rpId, challenge, and signature
  • store credential public key after registration
  • look up the credential on login and verify assertion

Important requirements

  • Your site must be served over HTTPS
  • localhost is allowed for development
  • Use the correct RP ID (usually your domain, e.g. example.com)
  • Match the browser origin exactly
  • Use a WebAuthn library instead of implementing crypto manually

Recommended libraries

Node.js

  • @simplewebauthn/server
  • @simplewebauthn/browser

Python

  • webauthn

Go

  • go-webauthn

Java

  • webauthn4j

Example architecture

  • Frontend: calls server for options, then uses WebAuthn browser APIs
  • Backend: verifies registration/authentication and stores credentials
  • Database: table for passkeys linked to user accounts

Example credential table:

  • id
  • user_id
  • credential_id
  • public_key
  • counter
  • transports
  • created_at

Best practices

  • Allow multiple passkeys per user
  • Offer passkeys as primary login, but consider fallback recovery
  • Support account linking to existing password accounts
  • Use “discoverable credentials” if you want username-less login
  • Keep good UX for platform vs cross-device authenticators

If you want, I can give you:

  1. a complete working example in Node/Express,
  2. a Next.js implementation, or
  3. a backend + frontend code sample for registration and login.

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.