Get your free and exclusive 80-page Banking Passkey Report

WebAuthn 中的 authenticatorSelection 是什么?

Vincent Delitz

Vincent

Created: July 11, 2025

Updated: July 12, 2025


See the original glossary version in English here.

authenticatorSelection 是什么?#

WebAuthn 中,authenticatorSelectionPublicKeyCredentialCreationOptions 对象的一个重要组成部分。该功能使信赖方 (RP) 能够在 create() 操作期间指定选择合适认证器的标准。其重要性在于:

  • 定义认证器要求: 规定了可以参与注册过程的认证器类型。
  • 认证器附加方式: 决定认证器是平台认证器(例如 Face ID、Touch ID、Windows Hello)还是跨平台(漫游)认证器
  • 用户验证: 设置用户验证的要求(例如,“preferred”、“required”或“discouraged”)。
Slack Icon

Become part of our Passkeys Community for updates & support.

Join

示例:#

"authenticatorSelection": { "authenticatorAttachment": "platform", "residentKey": "required", "requireResidentKey": false, "userVerification": "required", }

继续阅读,了解 authenticatorSelection 的可能值和配置的详细信息。

核心要点#

  • authenticatorSelection 用于在 WebAuthn 中指定选择认证器的要求。
  • 它包括认证器的附加方式和用户验证要求。
  • 通过精确控制认证过程来增强安全性。

WebAuthn 中的 authenticatorSelection 对于确保认证过程符合特定的安全要求和用户体验偏好至关重要。它为信赖方提供了根据其安全需求定制注册过程的灵活性。

以下是 WebAuthn 规范中指定的可能值的概述:

authenticatorAttachment#

可能的值:

  • Platform: 认证器附加在客户端的平台上,因此不可移除。
  • Cross-platform: 认证器不与客户端的平台绑定,可以在多个设备上使用。

residentKey#

此值指定信赖方是否希望创建可发现凭证。可能的值是:

requireResidentKey#

此值仅用于与 WebAuthn 级别 1 的向后兼容,如果 residentKey 设置为 "required",则此值设置为 "true"。

Substack Icon

Subscribe to our Passkeys Substack for the latest news.

Subscribe

userVerification#

此值表示操作是否需要用户验证。可能的值是:

  • required: 操作必须验证用户。
  • preferred: 操作应验证用户,但也可以在没有验证的情况下继续(标准值)。
  • discouraged: 操作不应验证用户。

警告: 如果设置为 "preferred",认证器可能会在认证过程中跳过用户验证。请在这篇文章中阅读有关此问题的更多信息。


authenticatorSelection 常见问题解答#

在 WebAuthn 中,authenticatorSelection 有什么作用?#

WebAuthn 中的 authenticatorSelection 允许信赖方指定适合其认证过程的认证器类型,包括对用户验证的要求和认证器的类型。

authenticatorSelection 如何影响认证中的用户体验?#

它通过确定所用认证器的类型(平台或漫游)并设置用户验证的级别来影响用户体验,从而影响认证过程的便捷性和安全性。

Debugger Icon

Want to experiment with passkey flows? Try our Passkeys Debugger.

Try for Free

authenticatorSelection 中的 authenticatorAttachment 设置有什么影响?#

The authenticatorAttachment setting in authenticatorSelection dictates whether a fixed platform authenticator or a removable cross-platform authenticator is required, affecting the physical and functional characteristics of the authentication process.

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

Start for free

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 Terms