Prompt

I'm building on AWS Cognito and want passkeys, how do I do it?

Technology / Identity & Access1 observationLast seen Oct 28, 2026

Latest observation

Oct 28, 2026OpenAI APIWeb search: off

You can add passkeys to an AWS Cognito app, but the exact path depends on what you mean by “use Cognito”:

  • Cognito User Pools don’t currently give you a simple “turn on passkeys” switch like they do for passwords/MFA.
  • The usual approach is to implement passkeys in your app layer and then federate or map that sign-in into Cognito.
  • If you want a fully native passwordless/passkey auth flow, you may need a custom auth flow or an external IdP that already supports passkeys.

The practical options

Option 1: Use passkeys in your app, then exchange for Cognito tokens

Best if you already use Cognito and want to keep it.

Flow:

  1. User signs in with a passkey using WebAuthn on your frontend.
  2. Your backend verifies the WebAuthn assertion.
  3. If valid, your backend issues a session/JWT or creates a Cognito-compatible login.
  4. Optionally, your backend can use Cognito custom auth to integrate that flow.

This is the most common “Cognito + passkeys” pattern.

Option 2: Use Cognito as the user directory, but delegate auth to an external IdP

If you use something like:

  • Auth0
  • Okta
  • Azure AD B2C
  • A passkey-capable custom IdP

Then Cognito can act as the broker/federation layer.

Option 3: Build a custom Cognito auth flow

Cognito supports custom authentication challenge flows with Lambda triggers:

  • DefineAuthChallenge
  • CreateAuthChallenge
  • VerifyAuthChallengeResponse

You can use these to implement a WebAuthn challenge/response flow.

This is the most “Cognito-native” way, but it’s also the most work.


Recommended architecture

If you want passkeys and Cognito together, I’d recommend:

Frontend

  • Use WebAuthn / passkeys in browser or native app
  • Libraries:
    • @simplewebauthn/browser
    • @simplewebauthn/server

Backend

  • Store passkey credentials:
    • credentialID
    • public key
    • counter
    • user ID
    • transports / device metadata if needed
  • Verify registration and authentication assertions server-side
  • After success, mint a session or start a Cognito custom auth flow

Cognito

  • Use a custom auth challenge or treat Cognito as the user directory after your app verifies identity

How to do it with Cognito custom auth

1. Enable custom authentication

In your Cognito User Pool client:

  • Enable CUSTOM_AUTH flow
  • Keep SRP/password disabled if you want passkey-only sign-in

2. Register passkey first

Typical registration flow:

  1. User enters email/username
  2. Backend checks whether the user exists in Cognito
  3. Backend creates a WebAuthn registration challenge
  4. Frontend calls navigator.credentials.create()
  5. Backend verifies attestation
  6. Backend stores the credential info linked to the Cognito user/sub

3. Authenticate with passkey

  1. User enters email/username
  2. Backend creates WebAuthn authentication challenge
  3. Frontend calls navigator.credentials.get()
  4. Backend verifies assertion
  5. If valid, Cognito custom auth Lambda returns success

Cognito Lambda triggers you’ll likely use

For custom auth:

  • DefineAuthChallenge: decides if auth is complete
  • CreateAuthChallenge: generates and sends/stores the challenge
  • VerifyAuthChallengeResponse: checks the answer

Important note:

  • Cognito doesn’t know WebAuthn natively
  • Your Lambda/backend must store the challenge and verify the signed assertion

Example implementation pattern

Registration

Backend:

  • Generate a WebAuthn registration options object
  • Save challenge in your DB/cache
  • Return options to client

Client:

  • navigator.credentials.create({ publicKey: options })

Backend:

  • Verify response
  • Save credential public key + credential ID against user

Login

Backend:

  • Generate WebAuthn login options for username
  • Save challenge
  • Return options

Client:

  • navigator.credentials.get({ publicKey: options })

Backend:

  • Verify assertion using stored credential public key
  • If valid, authenticate the user

Then either:

  • create your own session/JWT, or
  • call Cognito custom auth / token issuance flow

Important Cognito limitations to know

  • Cognito User Pools do not provide first-class passkey support comparable to a dedicated passkey IdP.
  • You cannot simply “enable passkeys” and be done.
  • If you need:
    • native passkey UX
    • device-bound login
    • synced passkeys
    • account recovery
    • step-up auth you’ll need to design these yourself.

If you want the simplest production approach

Best overall

  • Use WebAuthn passkeys in your app
  • Verify on your backend
  • Use Cognito only if you need it for:
    • user profile management
    • group/claim mapping
    • existing AWS integration

If you’re starting fresh and passkeys are the main auth method, consider whether Cognito is still the best primary auth system for your use case.


What I can give you next

I can help you with any of these:

  1. A working architecture diagram
  2. A step-by-step AWS Cognito custom auth setup
  3. Node.js backend code using SimpleWebAuthn
  4. React frontend passkey registration/login code
  5. Lambda trigger examples for Cognito custom auth

If you want, I can give you a complete end-to-end sample for:

  • Cognito + passkeys + Node.js + React

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.