The user wants me to design a WebAuthn ceremony. This is a system design and user experience (UX) challenge that integrates three complex components:
- Cross-device flows: Allowing a user to authenticate on one device (e.g., a laptop) using an authenticator on another device (e.g., a phone).
- Passkey syncing: Leveraging the synchronization of passkeys across devices (e.g., Apple iCloud Keychain, Google Password Manager) for availability.
- Phishing-resistant recovery: Ensuring that if a user loses access to their synced passkeys (device loss, account lockout), they can recover access without introducing phishing vulnerabilities (like SMS OTPs or weak knowledge-based auth).
Deconstructing the Request:
- Goal: A comprehensive flow/ceremony.
- Core Technology: WebAuthn (FIDO2).
- Key Features:
- Cross-Device: Use a phone to sign into a desktop.
- Syncing: The credential is synced (Passkey).
- Recovery: Must be phishing-resistant.
Mental Model & Flow Construction:
-
Phase 1: Registration (The Setup).
- User creates an account.
- Must create a passkey.
- Crucial Step for Recovery: Need a "Recovery Key" or a separate "Recovery Passkey" immediately to handle the "phishing-resistant recovery" requirement later. Or, rely on a trusted third party (Identity Provider) method, but the prompt implies a direct design. Let's go with a "Recovery Passkey" or "Encrypted Recovery Secret" stored securely.
-
Phase 2: Standard Authentication (The Happy Path).
- User is on a new laptop (Device B).
- User initiates login.
- Option 1: Cloud Assisted Bluetooth (caBLE) / Hybrid transport. Use phone (Device A) where passkey exists.
- Option 2: Use a synced passkey if already available on Device B (if the ecosystem allows).
-
Phase 3: Cross-Device Flow (The Specific Request).
- Scenario: Device B has no passkey. Phone (Device A) has the passkey.
- Mechanism: QR code scanning (hybrid transport).
- User scans QR with phone, authorizes with biometrics, signature sent to RP (Relying Party) via Device B.
-
Phase 4: Phishing-Resistant Recovery (The Hard Part).
-
The Problem: User loses Device A and Device B. No synced passkeys accessible.
-
Traditional (bad) solution: SMS OTP or Email link (phishable).
-
Better solution: Recovery Codes (MFA style) - usually typed, weak.
-
Phishing-resistant solution:
- Option A: A distinct, non-synced FIDO2 security key (YubiKey). Best, but requires hardware purchase.
- Option B: A "Recovery Passkey" stored on a separate secure location. E.g., printed QR code (paper-based YubiKey equivalent) or a backup device.
- Option C: Account Recovery via Trusted Identity Provider (IdP). Using OIDC (Sign in with Apple/Google) as a backup.
- Option D: Cryptographic Recovery Key. Similar to Option B, but maybe a long string encoded in a QR code or downloadable file.
-
Decision: Let's design a ceremony that generates a Cryptographic Recovery Passkey (a distinct credential) or allows the use of a Hardware Security Key as a backup. But since the prompt asks to bridge syncing, I should focus on how to regain syncing status securely.
-
Refined Recovery Idea: "Custodial Recovery Credential."
- During registration, the RP generates a unique, high-entropy secret (Recovery Secret).
- This secret is wrapped in a WebAuthn ceremony (signed by the user's primary passkey) and stored encrypted by the RP.
- To recover: The user must present some form of identity verification (IdV) to unlock this secret, OR better yet, use a pre-registered "Recovery Contact" or a Paper-based WebAuthn Challenge.
- Actually, let's stick to the strict "Phishing-Resistant" constraint. This eliminates SMS/Email.
- Solution: The "Spare Key" Ceremony.
- Single-Device Fallback: User creates a second credential on a Hardware Key OR a "Printed Passkey" (a complex QR containing a private key, though this is non-standard and experimental).
- Social Recovery (Web of Trust): Not widely implemented in WebAuthn directly.
- Identity Provider Vouching: "Sign in with [Provider]" where the Provider handles the MFA.
Let's go with the most practical, high-security design:
- Primary: Synced Passkey (iCloud/Google).
- Cross-Device: Hybrid Transport (QR Code).
- Recovery: Cryptographic Recovery Code (encoded as a QR code to scan, not type) OR Backup FIDO2 Security Key.
Correction: A "code" you type is not phishing resistant (MITM can proxy it). A "code" you scan/verify cryptographically is resistant if it's a challenge-response.
Let's use the "Recovery Passkey" approach. The user must create a distinct backup credential (on a USB key or a paper backup key) at setup.
Structuring the Output:
I will structure this as a formal protocol specification/ceremony guide.
- Architecture Overview: Define the actors (User, Browser, RP, Authenticator).
- The Registration Ceremony (Laying the Foundation): Focus on creating a "Resident Credential" and a "Recovery Credential."
- The Cross-Device Authentication Ceremony (The Bridge): Detailing the
hybrid transport (QR code).
- The Recovery Ceremony (The Safety Net): The phishing-resistant mechanism (avoiding OTPs).
Drafting the Content - Section by Section:
Synthesizing the Design:
The design needs to be cohesive.
- Concept: "The Trusted Circle" Architecture.
- Credential A: The Daily Driver (Synced Passkey).
- Credential B: The Bridge (Cross-device via QR).
- Credential C: The Lifeboat (Recovery Credential).
Let's refine the "Phishing-Resistant Recovery":
Most recovery flows fail because they fall back to "shared secrets" (passwords, OTPs). To remain phishing resistant, we must stay asymmetric.
The only way to recover without a second device present is to have stored a credential elsewhere.
Proposed Solution: Encrypted Backup via Cloud Storage (User controlled).
Or simpler: Require a "Recovery Passkey" generated on a USB Key or a separate "Printable" WebAuthn credential (like a paper YubiKey).
Let's propose a "Printed QR Recovery Passkey".
How it works: The browser generates a key pair. Private key is printed as a high-density QR code. Public key is stored by RP.
Usage: During recovery, user scans the paper QR with their webcam (or a new phone's camera). The browser uses the scanned private key to sign the WebAuthn challenge.
Let's formalize the Ceremony Steps.
Phase 1: Enrollment (The Setup)
- Create Primary Synced Passkey.
- Requirement: Generate "Break-glass" Credential.
- Option A: USB Security Key (Roaming).
- Option B: "Printable Passkey" (Private key encoded in PDF).
Phase 2: Cross-Device Login (The Flow)
- Laptop requests assertion.
- User selects "Try another way" -> "Use a passkey from a phone."
- Browser creates QR.
- Phone scans, establishes BLE/TCP tunnel.
- Phone creates assertion.
- Laptop forwards to RP.
Phase 3: Recovery (The Lost Access)
- User is on new device. No phone, no old laptop.
- "I lost my devices."
- System prompts for Recovery Method.
- If Option B (Printable):
- User shows paper QR to Webcam.
- Browser extracts key, signs challenge.
- Access granted.
- Immediate Action: Force enrollment of a new Primary Synced Passkey.
Refining the "Phishing-Resistant Recovery" constraints:
The prompt asks to bridge these.
Maybe the recovery uses the syncing provider?
No, that defeats the purpose of "recovery" if you are locked out of the syncing provider.
I will stick to the Multi-Credential Recovery model.
Detailed Protocol Design:
- Roles: User, Relying Party (RP), Client (Browser), Authenticator (Phone/Key/Paper).
- Terminology:
- Synced PRK (Platform Resident Key): The main passkey.
- Hybrid Transport: The mechanism for cross-device.
- Recovery Credential: The backup.
Let's write the response.
I will structure it as a technical specification for a "High-Assurance WebAuthn Implementation."
Outline:
- Executive Summary: The "Zero Shared Secret" goal.
- Architecture Components: The 3 keys (Synced, Cross-Device, Recovery).
- Ceremony 1: The "Future-Proof" Registration. (Creating the synced key + the backup).
- Ceremony 2: The Cross-Device Handshake. (Using the phone to sign on the laptop).
- Ceremony 3: The "Lifeline" Recovery. (Using the backup without SMS/OTP).
- Security Analysis: Why it works (Origin binding, no shared secrets).
Self-Correction during drafting:
Wait, is "Printable Passkey" standard? Not strictly in the WebAuthn L1/L2 spec as a standard browser feature (browsers don't usually let you "scan a private key from paper" via webcam to sign).
Correction: I should frame the recovery as using a Roaming Authenticator (Hardware Key) or a Recovery Code used in conjunction with a known device (which violates the prompt).
Better alternative: Managed Recovery with Identity Verification.
But the prompt asks for a design, so I can propose a design where the browser/app facilitates the scan of a recovery artifact (like a QR code acting as a software authenticator).
Or, simply rely on the standard Security Key as the recovery method. That is the only standard phishing-resistant recovery.
However, to be creative and answer the "bridging" part:
Maybe the recovery allows the user to temporarily downgrade to a "synced" state on a new device via a highly secure channel?
No, stick to the "Printed/Software Recovery Key" concept. It's a valid design pattern (like a "Paper Wallet" in crypto). I will define a custom client-side handler for this.
Actually, there is a newer standard: Device-bound Session Credentials, but that's session management.
Let's stick to: Backup Security Key (Hardware) OR App-bound Recovery Code.
Actually, Google Advanced Protection allows using a previously created code.
Let's design a "Recovery Passcode wrapped in WebAuthn"? No.
Final Decision on Recovery: The recovery ceremony will rely on a Backup Passkey stored on a physical security key (Roaming Authenticator) OR a Recovery Contact (Social Recovery).
Wait, let's look at the "Passkey Syncing" part again. If I sync via iCloud, recovery is Apple's problem. But the prompt asks me to design the ceremony bridging these.
Okay, the design is:
- Primary: Synced Passkey (Apple/Google).
- Cross-Device: QR Code / Hybrid.
- Recovery: Account Recovery Cryptographic Key (ARCK).
- Generated at setup.
- Stored offline (Paper/USB).
- Used to sign a specific "Recovery Challenge" to authorize a new device registration.
I will present this as the "Tri-Redundant Passkey Ceremony."
Structure:
- Conceptual Framework: The Trinity (Synced, Hybrid, Recovery).
- Flow 1: Registration. (The setup of the trinity).
- Flow 2: Cross-Device Auth. (Hybrid transport details).
- Flow 3: Phishing-Resistant Recovery. (The "Lifeboat" mechanism).
- Technical Implementation Details (Extensions, Transports).
This covers all requirements. I will ensure the recovery part is distinct and clearly phishing-resistant (i.e., based on origin-bound signatures, not static codes).
Self-correction on Recovery:
How does a static "Recovery Key" work?
The RP stores the Public Key.
The User holds the Private Key (on a USB drive or printed QR).
During recovery:
- User goes to RP login page.
- Selects "Recover with Backup Key."
- Browser requests WebAuthn assertion.
- This requires a specialized "Software Authenticator" or "Single-Use Token" logic.
Actually, the easiest way to implement "Phishing Resistant Recovery" without hardware is Device Authorization via a Trusted Third Party.
But the most pure WebAuthn design is: You must have a second credential.
I will focus on the Multi-Device Syncing capabilities to act as recovery (e.g., if I lose my phone, I use my iPad). This is the "Syncing" part answering recovery.
BUT, what if I lose all synced devices?
Then I need the "Break-Glass" Credential.
Let's execute.
- Title: The "Resilient Identity" Ceremony.
- Components:
primary_credential: Synced passkey.
transport: hybrid (QR).
recovery_credential: roaming (USB/NFC) or static-backup (Printed QR).
I will detail the Hybrid Flow carefully (caBLE).
I will detail the Recovery Flow as a specific "Re-registration" ceremony authorized by a cryptographic signature.
Let's write.
This design outlines a comprehensive WebAuthn ceremony termed "Trusted Circle with Hybrid Recovery."
It integrates:
- Synced Passkeys (Primary): For seamless daily access.
- Cross-Device (Hybrid) Flows: For using a phone to authenticate on a desktop.
- Phishing-Resistant Recovery: A mechanism to recover accounts without SMS or email codes.
1. Architecture Overview
This system relies on three distinct logical states for a user’s credentials:
- The Daily Driver (Synced): A passkey synced via iCloud Keychain or Google Password Manager.
- The Bridge (Hybrid): The mechanism to use the "Daily Driver" on a device that lacks it (e.g., logging into a shared Windows PC using your iPhone passkey).
- The Anchor (Recovery): A non-synced, hardware-bound credential (or cryptographic secret) stored on a recovery device (like a YubiKey or a second phone) used solely for account restoration.
2. Phase I: The "Future-Proof" Registration
To support the full lifecycle, registration must establish the "Anchor" immediately.
- User initiates signup on a primary device (e.g., Laptop).
- Standard Creation: The Relying Party (RP) requests
navigator.credentials.create().
- Authenticator Selection:
platform (to encourage synced passkeys).
- Attestation:
direct (optional, to verify device integrity).
- The "Anchor" Setup (Crucial Step):
- After the primary passkey is created, the user is prompted: "Add a recovery device to protect your account."
- The RP generates a high-entropy Recovery Secret.
- The user scans a QR code or taps a NFC card (YubiKey) using their secondary device (e.g., a hardware key or a spare phone).
- This secondary device creates a non-synced, hardware-bound credential that wraps the Recovery Secret.
- Result: The user has a synced passkey for daily use and a physical Anchor for disasters.
3. Phase II: Cross-Device Authentication (The Bridge)
This flow handles the scenario where a user is on a new computer but has their phone.
- Initiation: User enters username on the Laptop (Device A).
- RP Challenge: The RP detects no local passkey is available and returns a specific error/option:
startHybridFlow.
- QR Code Display: Device A displays a QR code containing a
handoverHash.
- Scanning: User scans with Phone (Device B).
- Under the hood: This establishes a secure BLE (Bluetooth Low Energy) or Cloud-assisted tunnel between the two devices.
- Ceremony Execution:
- Device B requests user verification (Biometric).
- Device B sends the WebAuthn assertion through Device A to the RP via the established tunnel.
- Success: Device A receives a session cookie.
- UX Feature: Device A prompts: "Save this passkey on this laptop?" (Syncing the credential to the new device).
4. Phase III: Phishing-Resistant Recovery (The Lifeboat)
This is the most complex part. Traditional recovery uses OTPs (phishable). This design uses Device-Bound Recovery Keys.
Scenario: User loses their phone (with synced passkeys) and buys a new phone. They have their physical Anchor (YubiKey or a distinct recovery app on a tablet).
- Initiation: User clicks "I lost my device" on the Login page.
- Identity Proofing (Step-Up Auth):
- The RP prompts for the Anchor Credential.
- User plugs in their YubiKey or uses their tablet to sign a challenge.
- The Recovery Ceremony:
- Verification: The RP verifies the Anchor’s signature. This unlocks the stored Recovery Secret (or authorizes the rotation of keys).
- Action: The RP immediately initiates a
navigator.credentials.create() event on the new device.
- Binding: The new device creates a fresh Passkey.
- Key Rotation:
- The RP invalidates all previous credential IDs associated with the lost phone's sync chain.
- The new credential is registered.
Why is this phishing-resistant?
The attacker cannot trick the user into sending a code (OTP). The user must possess the cryptographic Anchor and perform a cryptographic signature on the specific origin (domain) to unlock the recovery flow. If the user is on a fake site, the Anchor will refuse to sign for that origin.
5. Technical Protocol Details
A. WebAuthn Extensions Used
credProps (rk): To verify if the created credential is a Discoverable Credential (Passkey).
largeBlob: (Optional) To store encrypted recovery data directly on the authenticator for true local recovery without server state.
credProtect: To ensure the Recovery Key requires user verification before use.
B. The Recovery "Shard" (Implementation Strategy)
To avoid needing a YubiKey, you can implement Social Recovery or Trusted Device Recovery:
- The Design:
- During registration, the Primary Device creates a cryptographic key pair.
- The Private Key is split into 3 shards using Shamir's Secret Sharing.
- Shard A is stored on the Server (encrypted).
- Shard B is stored on the user's Laptop.
- Shard C is stored on the user's Tablet.
- The Recovery:
- If the Phone is lost, the user logs into the Website on their Laptop (using password/PIN).
- They use their Tablet to verify identity (via a deep link/app).
- The Server releases Shard A. The Laptop has Shard B. The Tablet provides Shard C.
- 3 shards are combined to reconstruct the Private Key, which authorizes the registration of a new Phone Passkey.
6. Summary of UX Flow
- Onboarding: User sets up FaceID/TouchID passkey. System asks for a backup USB key or a trusted family member's device as a "Safety Net."
- Daily Login: Auto-fill username, FaceID, done.
- New Device (Cross-Device): Show QR code -> Scan with Phone -> FaceID -> Logged in.
- Disaster (Recovery): "Lost Phone?" -> Insert USB Key -> New Passkey created -> Access restored.