Get your free and exclusive 80-page Banking Passkey Report
passkeys incognito mode cover

Passkeys 能在无痕模式下使用吗?

了解 Passkeys / WebAuthn 是否以及如何在 Chrome、Safari、Edge 和 Firefox 的无痕或私密浏览模式下工作。

Vincent Delitz

Vincent

Created: August 8, 2025

Updated: August 8, 2025


See the original blog version in English here.

Our mission is to make the Internet a safer place and passkeys provide a superior solution to achieve that. That's why we want to keep you updated with the latest industry insights here.

1. 引言#

越来越多的公司正在其网站和应用中引入 Passkeys。在此过程中,许多软件开发者和产品经理都会问自己Passkeys 是否能在无痕或私密浏览模式下工作,因为这会直接影响整体的用户体验。

在这篇博客中,我们将尝试回答以下问题:

  1. Passkeys 能在无痕/私密浏览模式下使用吗?
  2. 在 Chrome、Safari、Edge 和 Firefox 的无痕/私密模式下,Passkey 认证的行为是怎样的?

了解这些知识有助于确保在不同浏览器和操作系统上提供流畅的用户体验,让您的应用在安全性和便利性方面保持领先。

2. Passkeys 与无痕模式:概述#

Passkeys 本质上是用于验证用户的加密密钥,无需使用传统密码。它们通过消除与密码盗窃和网络钓鱼攻击相关的风险,提供了更高的安全性。

通常,Passkeys 安全地存储在设备内部,即使在无痕或私密模式下,其功能也基本保持一致(除了 Windows 10,详见下文),前提是设备支持 Passkey。

Substack Icon

Subscribe to our Passkeys Substack for the latest news.

Subscribe

无痕或私密模式通常用于在不留下痕迹的情况下浏览互联网。对于注重隐私的用户来说,这项功能非常重要,因此像 Passkeys 这样的认证方法必须能在这些模式下无缝工作。

然而,在 WebAuthn 的发展历史中,相关讨论和改进一直在进行,因为其行为在不同操作系统和浏览器之间曾经相当混乱和不一致(可参考这些旧的讨论和错误报告:这里这里这里)。

3. Passkeys 在不同浏览器和操作系统中的行为#

了解 Passkeys 在各种浏览器和操作系统中的行为,有助于确保兼容性和流畅的用户体验。

Passkeys 能在无痕/私密浏览模式下使用吗?

Windows 10Windows 11Android 14iOS 17.5macOS 14
Chrome✅ (有额外屏幕提示)
Edge✅ (有额外屏幕提示)
Safari不适用不适用不适用
Firefox

3.1 Windows 10 上 Passkeys 在 Chrome 无痕模式 / Edge InPrivate 模式下的行为(版本 129 之前)#

在 Windows 10 (22H2) 上,我们发现了 Passkeys 无法可靠工作的唯一例外情况,在尝试使用平台验证器Windows Hello)时,我们看到了以下两个截图:

Windows 10 上 Chrome 无痕模式的 Passkey 错误信息

Windows 10 上 Edge InPrivate 模式的 Passkey 错误信息

当我们切换到常规浏览模式时,一切都正常工作,所以弹窗中的错误信息是有误导性的。

此外,如果我们尝试使用跨平台验证器(例如硬件安全密钥,如 YubiKey,或通过二维码/蓝牙进行跨设备认证),则可以正常工作。

当我们深入研究这个问题,并在浏览器控制台中执行以下两个命令来确定平台验证器PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable())和条件式 UIPublicKeyCredential.isConditionalMediationAvailable())是否可用时,我们有了一个有趣的发现:第一个 promise 返回 false,而第二个返回 true。这完全说不通,因为条件式 UI 的工作需要平台验证器

Slack Icon

Become part of our Passkeys Community for updates & support.

Join

3.2 Windows 10 上 Passkeys 在 Chrome 无痕模式 / Edge InPrivate 模式下的行为(版本 129 及之后)#

从 Chrome 129 开始(Edge 基于 Chromium,情况类似),PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() 即使在 Windows 10 的无痕/InPrivate 模式下也会返回 true。此前,在无痕模式下该值为 false。尽管现在返回 true,但平台验证器仍然无法用于创建新的 Passkey,导致用户流程中断。

下表显示了 PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable() 在 Windows 10 上不同 Chrome/Edge 版本和模式下的返回值:

浏览器/版本普通模式 (W10)无痕/私密模式 (W10)UI 中的行为
Chrome ≤ 128 (变更前)truefalse无痕模式下无平台验证器
Chrome ≥ 129truetrue提示使用安全密钥,而非平台验证器
Edge ≤ 128 (变更前)truefalseInPrivate 模式下无平台验证器
Edge ≥ 129truetrue提示使用安全密钥,而非平台验证器

观察到的行为:

变更的影响: 这实际上中断了在无痕/InPrivate 模式下向平台验证器添加 Passkey 的流程。Chrome 129+ 的调整主要是为了在无痕模式下启用 Passkey 登录功能。登录流程使用相同的检测机制(PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable())来检查 Passkey 支持,这一更改确保了登录可以顺利进行。然而,其意想不到的后果是在私密浏览模式下使用平台验证器创建 Passkey 的体验被破坏了。

有关此变更的更多详细信息,可以在 Chromium 源代码审查和相关的问题跟踪器讨论中找到。对于希望为 Passkeys 提供最佳支持的网站来说,目前检测无痕模式是缓解此问题的唯一方法。通过识别用户何时在 Windows 10 上使用 Chrome/Edge 的无痕/InPrivate 模式,网站可以预先避免提供使用平台验证器创建 Passkey 的选项。

3.3 Windows 11 上 Passkeys 在无痕模式 / Edge InPrivate 模式下的行为#

当使用 Windows Hello 作为平台验证器时,在无痕模式(Chrome)/ InPrivate 模式(Edge)下创建 Passkey 期间会出现一个安全弹窗,提醒用户该 Passkey 将被存储,并可在非无痕模式下使用(此行为在 Windows 11 22H2 上测试过)。考虑到无痕模式的其中一个用例是用户希望在不留下任何信息痕迹的情况下创建账户,这个警告是合理的。

3.4 Android 上 Passkeys 在 Chrome 无痕模式 / Edge InPrivate 模式下的行为#

Android 上使用无痕模式(Chrome)/ InPrivate 模式(Edge)时,其行为与 Windows 11 类似,会显示一个信息弹窗,告知用户该 Passkey 将保存在密码管理器中,任何有权访问该密码管理器的人也将有权访问该 Passkey。

4. 结论#

总而言之,Passkeys 在主流浏览器和操作系统中的无痕和私密模式下都能可靠地工作,但在 Windows 10 上创建 Passkey 时存在一些特定的例外情况。通过利用 Corbado 的解决方案,开发者可以高效地实施 Passkeys,产品经理也可以在不牺牲安全性的前提下提升用户体验。

Add passkeys to your app in <1 hour with our UI components, SDKs & guides.

Start Free Trial

Share this article


LinkedInTwitterFacebook

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.

Related Articles