# WebAuthn

**WebAuthn**（Web认证）是一项W3C标准，定义了一套API，Web应用借此创建并使用强健的、经过证明的、有作用域限制的、基于公钥的凭证来认证用户；该标准与FIDO联盟联合制定，是FIDO2规范集的浏览器端组件。<sup>[1](https://www.w3.org/press-releases/2019/webauthn/)</sup> 与使用密码之类的共享秘密不同，用户的设备（即认证器）持有一个私钥，对网站发出的挑战进行签名，网站再用相应的公钥验证签名。第1级于2019年3月4日成为W3C正式推荐标准，第2级于2021年跟进，第3级于2026年8月25日达到推荐标准状态。<sup>[1](https://www.w3.org/press-releases/2019/webauthn/)</sup><sup> • </sup><sup>[2](https://fidoalliance.org/webauthn-level-3-is-now-a-w3c-recommendation/)</sup>

| 关键事实 | 详情 |
|---|---|
| 标准状态 | 第1级 W3C推荐标准 2019年3月4日；第3级 W3C推荐标准 2026年8月25日<sup>[1](https://www.w3.org/press-releases/2019/webauthn/)</sup><sup> • </sup><sup>[2](https://fidoalliance.org/webauthn-level-3-is-now-a-w3c-recommendation/)</sup> |
| 在FIDO2中的位置 | WebAuthn是浏览器/服务器标准；CTAP2规定安全密钥或设备如何与浏览器通信<sup>[3](https://www.itpro.com/security/how-resellers-can-win-with-smarter-multi-factor-authentication-mfa)</sup> |
| 凭证模型 | 以依赖方ID为作用域的公钥凭证；认证器确保凭证只能用于同一RP ID所请求的操作<sup>[4](https://lists.w3.org/Archives/Public/public-webauthn/2016May/att-0226/Web_Authentication__A_Web_API_for_accessing_scoped_credentials.pdf)</sup> |
| 仪式 | 注册创建凭证并将其与用户账户关联；认证生成断言，证明用户在场并同意<sup>[5](https://www.w3.org/TR/webauthn-3/)</sup> |
| 抗钓鱼 | 请求方的完整源被包含并签署在证明对象和所有断言中，因此依赖方可拒绝来自不受信任域的请求<sup>[6](https://www.w3.org/TR/2026/REC-webauthn-3-20260825/)</sup> |
| 认证器类型 | 平台认证器运行在用户设备上；漫游认证器通过USB、低功耗蓝牙或NFC访问<sup>[5](https://www.w3.org/TR/webauthn-3/)</sup> |

## 工作原理

WebAuthn定义了两种仪式，涉及用户、依赖方（即网站或服务）以及用户的客户端平台——该平台包含或连接至少一个认证器。<sup>[5](https://www.w3.org/TR/webauthn-3/)</sup> 在**注册**中，依赖方要求浏览器创建新凭证；[认证](https://www.edgepedia.org/zh/authentication)器生成一对为该用户和该依赖方所独有的密钥，并在征得用户同意后将公钥发送给依赖方。<sup>[5](https://www.w3.org/TR/webauthn-3/)</sup><sup> • </sup><sup>[7](https://www.nass.org/sites/default/files/2020-05/Yubico%20White%20Paper%20How%20WebAuthn%20Works.pdf)</sup> 在**认证**中，依赖方发送一个挑战，认证器用凭证的私钥对其签名；浏览器将响应返回给依赖方服务器进行验证。<sup>[8](https://webauthn.wtf/how-it-works/authentication)</sup> 依赖方在两种仪式中控制API选项，并且必须在做出信任决定之前验证响应。<sup>[9](https://webauthn.wtf/how-it-works/relying-party)</sup>

该API通过`PublicKeyCredential`接口暴露，注册时配合`navigator.credentials.create()`使用，认证时配合`navigator.credentials.get()`使用。<sup>[5](https://www.w3.org/TR/webauthn-3/)</sup> 每次签名操作都需要进行用户在场检查，例如触摸安全密钥；认证器负责确保未经用户同意不执行任何操作。<sup>[10](https://www.usenix.org/system/files/conference/usenixsecurity26/sec26_prepub_jannett.pdf)</sup><sup> • </sup><sup>[5](https://www.w3.org/TR/webauthn-3/)</sup>

**作用域与源绑定。** 每个凭证属于一个依赖方ID，即客户端在所有操作中提供给认证器的域名；认证器强制规定，为一个RP ID创建的凭证不能被另一个RP ID使用。<sup>[4](https://lists.w3.org/Archives/Public/public-webauthn/2016May/att-0226/Web_Authentication__A_Web_API_for_accessing_scoped_credentials.pdf)</sup> 规范还要求浏览器将通行密钥操作的完整源包含在签名数据中，以便依赖方能够决定是否信任它，并拒绝来自不受信任的子域或同级域的请求。<sup>[10](https://www.usenix.org/system/files/conference/usenixsecurity26/sec26_prepub_jannett.pdf)</sup> 这种源绑定正是抗钓鱼背后的机制：用户可能被骗交出密码或短信验证码，但无法被骗为认证器并未与之通信的域生成有效签名。<sup>[11](https://www.techradar.com/pro/authentication-in-2026-moving-beyond-foundational-mfa-to-tackle-the-new-era-of-attacks)</sup>

**证明。** WebAuthn定义了一种可选机制，认证器借此向依赖方提供关于认证器自身及其所产生数据（如密钥对或已签名断言）的可验证证据。<sup>[12](https://developer.mozilla.org/en-US/docs/Web/Security/Authentication/Passkeys)</sup> 规范定义了几种证明声明格式，包括packed、TPM、Android Key、FIDO U2F、无证明、Apple匿名和复合格式。<sup>[5](https://www.w3.org/TR/webauthn-3/)</sup>

## 认证器与通行密钥

认证器可以实现为通用设备上的软件，也可以实现在设备内的安全执行环境、可信平台模块（TPM）或安全元件中，或者实现在设备之外。设备内实现称为平台认证器；设备外的漫游认证器通过USB、低功耗蓝牙（BLE）或NFC连接。<sup>[5](https://www.w3.org/TR/webauthn-3/)</sup>

一种设计上的区别对部署很重要：WebAuthn传统上依赖绑定设备的加密密钥，这类密钥本身不具备在用户的不同设备之间移植的能力；而同步通行密钥则将密钥材料存储在凭证提供方的云端。<sup>[13](https://arxiv.org/abs/2601.06554)</sup> 这一区别具有监管层面的后果。根据NIST SP 800-63B，保证等级2（AAL2）的认证必须提供抗钓鱼选项，而AAL3要求使用具有不可导出私钥的抗钓鱼认证器；由于可同步认证器要求私钥可导出，因此AAL3不允许使用这类认证器。<sup>[14](https://pages.nist.gov/800-63-4/sp800-63b.html)</sup>

## 第3级

WebAuthn第3级于2026年8月25日成为完整的W3C推荐标准，弥合了浏览器、操作系统和凭证管理器已经交付的功能与规范正式认可的内容之间的差距。<sup>[2](https://fidoalliance.org/webauthn-level-3-is-now-a-w3c-recommendation/)</sup> 其定义的客户端扩展包括`appid`、`appidExclude`、`credProps`、`prf`和`largeBlob`。<sup>[15](https://github.com/w3c/webauthn/wiki/Security-and-Privacy-Self%E2%80%90Review%3A-WebAuthn-L1%2C-L2%2C-L3)</sup>

**PRF扩展**（伪随机函数）建立在hmac-secret认证器原语之上，允许依赖方从通行密钥中派生稳定的、按凭证区分的密钥材料，用于端到端加密密钥派生等场景。<sup>[2](https://fidoalliance.org/webauthn-level-3-is-now-a-w3c-recommendation/)</sup><sup> • </sup><sup>[15](https://github.com/w3c/webauthn/wiki/Security-and-Privacy-Self%E2%80%90Review%3A-WebAuthn-L1%2C-L2%2C-L3)</sup> **Signal API**允许依赖方向认证器传达凭证变更：`signalUnknownCredential`可以删除服务器不再识别的孤立凭证，此外还有`signalAllAcceptedCredentials`和`signalCurrentUserDetails`。<sup>[16](https://github.com/w3c/webauthn/wiki/Level-3-Implementations)</sup><sup> • </sup><sup>[17](https://www.ncsc.gov.uk/paper/traditional-user-and-fido2-credentials-personal-use)</sup> 第3级还支持相关源请求（Related Origin Requests），允许依赖方验证其凭证在一组相关域中的使用。<sup>[16](https://github.com/w3c/webauthn/wiki/Level-3-Implementations)</sup> 第4级的工作已经在进行中。<sup>[2](https://fidoalliance.org/webauthn-level-3-is-now-a-w3c-recommendation/)</sup>

## 采用与部署

所有主流浏览器多年来都至少支持WebAuthn第1级，各平台也支持软件通行密钥提供方，例如消费级凭证管理器。<sup>[18](https://lists.w3.org/Archives/Public/public-credentials/2023Sep/att-0048/FIDO_WebAuthn_CCG_2023.pdf)</sup> 采用速度增长很快：一项行业调查报告称，抗钓鱼认证器的使用量在一年内增长了63%，而基于短信的验证从17.5%下降到15.3%。<sup>[11](https://www.techradar.com/pro/authentication-in-2026-moving-beyond-foundational-mfa-to-tackle-the-new-era-of-attacks)</sup> 政府指南将FIDO2视为领先的抗钓鱼方法；例如，CISA被引用为推荐将其用于抗钓鱼多因素认证。<sup>[3](https://www.itpro.com/security/how-resellers-can-win-with-smarter-multi-factor-authentication-mfa)</sup>

部署仍然存在摩擦。一项可用性研究中，118名专业人员分享了亲身经验，指出了具有挑战性的企业身份生命周期用例，例如远程劳动力和遗留系统，这些在早期的安全与可用性文献中很少受到关注。<sup>[19](https://arxiv.org/abs/2308.08096)</sup> 研究人员还审视了威胁模型本身，包括针对FIDO元数据服务的攻击向量——该服务是设备证明中所用认证器元数据的信任根。<sup>[20](https://arxiv.org/abs/2609.03789)</sup>

## References

1. [W3C and FIDO Alliance Finalize Web Standard for Secure, Passwordless Logins, W3C press release, 4 March 2019](https://www.w3.org/press-releases/2019/webauthn/)
2. [WebAuthn Level 3 Is Now a W3C Recommendation, FIDO Alliance](https://fidoalliance.org/webauthn-level-3-is-now-a-w3c-recommendation/)
3. [How resellers can win with smarter Multi-Factor Authentication (MFA), ITPro](https://www.itpro.com/security/how-resellers-can-win-with-smarter-multi-factor-authentication-mfa)
4. [Web Authentication API, early W3C WebAuthn Working Group draft](https://lists.w3.org/Archives/Public/public-webauthn/2016May/att-0226/Web_Authentication__A_Web_API_for_accessing_scoped_credentials.pdf)
5. [Web Authentication: An API for accessing Public Key Credentials - Level 3, W3C Recommendation](https://www.w3.org/TR/webauthn-3/)
6. [Web Authentication Level 3, W3C Recommendation, 25 August 2026](https://www.w3.org/TR/2026/REC-webauthn-3-20260825/)
7. [How WebAuthn Works, Yubico white paper](https://www.nass.org/sites/default/files/2020-05/Yubico%20White%20Paper%20How%20WebAuthn%20Works.pdf)
8. [Authentication - How it Works, WebAuthn.wtf](https://webauthn.wtf/how-it-works/authentication)
9. [Relying Party - How it Works, WebAuthn.wtf](https://webauthn.wtf/how-it-works/relying-party)
10. [USENIX Security 2026 preprint on passkey ceremonies](https://www.usenix.org/system/files/conference/usenixsecurity26/sec26_prepub_jannett.pdf)
11. [Authentication in 2026 - moving beyond foundational MFA, TechRadar](https://www.techradar.com/pro/authentication-in-2026-moving-beyond-foundational-mfa-to-tackle-the-new-era-of-attacks)
12. [Passkeys - Security, MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/Security/Authentication/Passkeys)
13. [QES-Backed Virtual FIDO2 Authenticators, arXiv](https://arxiv.org/abs/2601.06554)
14. [NIST Special Publication 800-63B (Revision 4)](https://pages.nist.gov/800-63-4/sp800-63b.html)
15. [Security and Privacy Self-Review: WebAuthn L1, L2, L3, w3c/webauthn Wiki](https://github.com/w3c/webauthn/wiki/Security-and-Privacy-Self%E2%80%90Review%3A-WebAuthn-L1%2C-L2%2C-L3)
16. [Level 3 Implementations, w3c/webauthn Wiki](https://github.com/w3c/webauthn/wiki/Level-3-Implementations)
17. [Comparing the security properties of traditional user credentials and FIDO2 credentials, NCSC](https://www.ncsc.gov.uk/paper/traditional-user-and-fido2-credentials-personal-use)
18. [FIDO WebAuthn CCG 2023, W3C Credentials Community Group](https://lists.w3.org/Archives/Public/public-credentials/2023Sep/att-0048/FIDO_WebAuthn_CCG_2023.pdf)
19. [Challenges with Passwordless FIDO2 in an Enterprise Setting: A Usability Study, arXiv](https://arxiv.org/abs/2308.08096)
20. [Beyond the Trust Boundary: A Critical Reassessment of the FIDO2 Threat Model, arXiv](https://arxiv.org/abs/2609.03789)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › Web development and web-platform technologies › Device and hardware Web APIs

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/webauthn

English original: https://www.edgepedia.org/webauthn
