What are challenges for passkeys in cross-origin iframes?

Vincent Delitz

Vincent

Created: April 7, 2025

Updated: April 19, 2025

iframe passkeys webauthn cover

Read the full article

Discover how to create & login with passkeys in cross-origin iframes with our guide. Learn about iframes in WebAuthn, security policies, & implementation.

Read the full article

Already read by 5,000+ enterprise security leaders.


What are the main challenges when trying to use passkeys in a cross-origin iframe?#

Implementing passkeys within cross-origin iframes can significantly enhance user experience and security, but there are several common challenges developers frequently encounter:

1. Browser Compatibility#

  • Not all browsers uniformly support WebAuthn features in cross-origin iframes. As of now, Chrome and Firefox have implemented both passkey creation and authentication, while Safari supports only authentication.
  • This inconsistent support demands thorough cross-browser testing and potentially browser-specific solutions.
cross origin iframe passkey challenges

2. Permission Policy Configuration#

  • Misconfigured HTTP Permissions-Policy headers or missing allow attributes in the iframe can block passkey creation or login functionalities.
  • Developers must explicitly enable permissions using:
    <iframe src="https://example.com" allow="publickey-credentials-get; publickey-credentials-create"></iframe>

Additionally, HTTP headers must align with iframe permissions to ensure correct delegation.

Enterprise Icon

Get free passkey whitepaper for enterprises.

Get for free

3. Safari-Specific Limitations#

Safari currently doesn't allow passkey creation within cross-origin iframes, returning errors like:

NotAllowedError - The origin of the document is not the same as its ancestors.

There's no immediate workaround; developers must use alternative methods like redirects or pop-up flows for Safari users.

4. Native App WebView Constraints#

Native apps embedding WebViews often face additional restrictions since WebViews typically support only first-party passkeys (same domain as the app).

For third-party scenarios (like payments), developers must switch from embedded WebViews to system WebViews (e.g., ASWebAuthenticationSession on iOS or Custom Tabs on Android), ensuring proper passkey functionality across domains.

By addressing these challenges, developers can successfully implement seamless, secure, and robust passkey integrations within cross-origin iframe contexts.

iframe passkeys webauthn cover

Read the full article

Discover how to create & login with passkeys in cross-origin iframes with our guide. Learn about iframes in WebAuthn, security policies, & implementation.

Read the full article

Already read by 5,000+ enterprise security leaders.

Schedule a call to get your free enterprise passkey assessment.

Schedule a call

Enjoyed this read?

🤝 Join our Passkeys Community

Share passkeys implementation tips and get support to free the world from passwords.

🚀 Subscribe to Substack

Get the latest news, strategies, and insights about passkeys sent straight to your inbox.

Share this article


LinkedInTwitterFacebook