Skip to content

Conversation

@sea-snake
Copy link
Contributor

@sea-snake sea-snake commented Jan 26, 2026

Fall back to related origins request in Safari for cross-origin passkeys.

Changes

  • Specify rpId if a primary origin (id.ai) is found and the page is currently at another origin to use WebAuthn with a related origins request in Safari.
  • Don't use iframe render in authorization flow if browser is either desktop Safari or mobile iOS instead render page as is, falling back to related origins request.
  • Enable GUIDED_UPGRADE flag if current page isn't currently at the primary origin, this makes sure that desktop Safari and mobile iOS users still get the guided upgrade flow.

Tests

Tested with Chrome, Firefox and Safari on desktop (Windows and Mac) and mobile (Android and iOS) with Apple Passwords, Google Passwords, Windows Hello and Bitwarden.

@sea-snake sea-snake requested a review from aterga January 26, 2026 09:49
@sea-snake sea-snake changed the title Fall back to related origins request in Safari when creating cross-origin passkeys. Fall back to related origins request in Safari for cross-origin passkeys. Jan 26, 2026
@sea-snake sea-snake requested a review from Copilot January 26, 2026 09:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a fallback mechanism for cross-origin passkey authentication in Safari, which doesn't support WebAuthn credential creation in iframes. The solution uses WebAuthn's related origins request feature for Safari browsers (desktop and iOS) while maintaining iframe-based authentication for other browsers.

Changes:

  • Adds Safari/iOS browser detection to disable iframe rendering and fall back to related origins requests
  • Implements rpId parameter in WebAuthn options to enable cross-origin passkey operations using related origins
  • Enables the GUIDED_UPGRADE feature flag when users are on a non-primary origin

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/frontend/src/routes/(new-styling)/(cross-origin)/+layout.svelte Adds browser detection for Safari and iOS to conditionally disable iframe embedding for cross-origin authentication
src/frontend/src/lib/utils/discoverablePasskeyIdentity.ts Implements getRpId() function and updates credential creation/request options to support related origin requests by setting the appropriate rpId
src/frontend/src/lib/state/featureFlags.ts Updates GUIDED_UPGRADE flag initialization to automatically enable when page is accessed from a non-primary origin

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sea-snake sea-snake added this pull request to the merge queue Jan 26, 2026
Merged via the queue into main with commit e869a13 Jan 26, 2026
67 checks passed
@sea-snake sea-snake deleted the sea-snake/fallback-to-ror branch January 26, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants