Prompt
How do I support cross-device sign-in with passkeys?
Latest observation
To support cross-device sign-in with passkeys, you generally want to use the WebAuthn / Passkeys flow and make sure your product supports discoverable credentials and the platform/device options that allow users to authenticate on one device using a passkey stored on another.
Here’s the practical approach:
1) Use WebAuthn for passkeys
Passkeys are implemented through WebAuthn. You’ll need:
- A registration flow to create passkeys
- An authentication flow to use them
- Server-side verification of the WebAuthn attestation/assertion responses
2) Support discoverable credentials
For passkeys, especially cross-device use, you should create discoverable credentials (also called resident keys).
When creating credentials, request:
residentKey: "preferred"or"required"requireResidentKey: truefor older WebAuthn APIsuserVerification: "required"if you want stronger security
Example registration options:
{
"challenge": "...",
"rp": { "name": "Your App", "id": "example.com" },
"user": {
"id": "...",
"name": "alice@example.com",
"displayName": "Alice"
},
"pubKeyCredParams": [
{ "type": "public-key", "alg": -7 },
{ "type": "public-key", "alg": -257 }
],
"authenticatorSelection": {
"residentKey": "preferred",
"userVerification": "required"
},
"timeout": 60000,
"attestation": "none"
}
3) Allow cross-device authentication methods
Cross-device sign-in usually means a user can sign in on a device that doesn’t have the passkey locally, by using a passkey on another device. This is often done via:
- QR code
- Bluetooth proximity
- Phone-based passkey approval
On the browser side, this happens when you call navigator.credentials.get() with a passkey-friendly request. The browser and OS will surface cross-device options automatically if available.
Example authentication options:
{
"challenge": "...",
"rpId": "example.com",
"allowCredentials": [],
"userVerification": "required",
"timeout": 60000
}
Important note
If you want passkey-first / username-less sign-in, leave allowCredentials empty and rely on discoverable credentials. The browser can then show available passkeys and cross-device options.
4) Make sure your UX supports this flow
Your UI should:
- Offer a “Sign in with passkey” button
- Not force the user to type a username first if you want username-less sign-in
- Provide fallback sign-in methods if passkeys aren’t available
- Explain that the user can approve sign-in from another device
Typical UX:
- User clicks “Sign in with passkey”
- Browser shows local passkeys or “Use a passkey from another device”
- User scans QR code or confirms on phone
- Authentication completes
5) Verify origin and RP ID correctly
Cross-device sign-in only works securely if:
- Your site uses HTTPS
- Your RP ID matches your domain
- You verify:
- challenge
- origin
- RP ID hash
- user presence / verification
- signature
6) Store multiple passkeys per user
Users often have several passkeys:
- Phone
- Laptop
- Tablet
- Security key
Let them manage and name/remove passkeys in account settings.
7) Provide fallback login
Not all environments support passkeys equally well. Keep fallback options such as:
- Email magic link
- Password + 2FA
- Recovery codes
- Support-assisted recovery
8) Test the cross-device scenarios
Test on combinations like:
- Desktop browser + mobile phone passkey
- iOS Safari + iPhone passkey
- Android Chrome + Google Password Manager passkey
- Windows/macOS browsers with synced passkeys
9) Platform specifics
Support depends on browser/OS capabilities:
- iOS/macOS: strong passkey support in Safari and system UI
- Android: good support via Chrome and Google Password Manager
- Windows: support varies by browser and credential provider
- Cross-device flows often rely on a phone acting as the authenticator
Minimal implementation checklist
- Use WebAuthn
- Register discoverable credentials
- Request
userVerification: "required" - Use
navigator.credentials.get()for sign-in - Leave
allowCredentialsempty for passkey-first flows - Verify assertions server-side
- Support QR / phone-based cross-device prompts via browser UI
- Add fallback login methods
If you want, I can also give you:
- a full WebAuthn passkey registration + sign-in example, or
- a cross-device passkey UX flow diagram.
Brands