Resident credential:读懂 WebAuthn 的旧设置名称
resident credential/key 是 discoverable credential 的旧称。residentKey 的取值表示 RP 的要求。
发布 更新
Resident credential:读懂 WebAuthn 的旧设置名称
在当前 WebAuthn 中,resident credential 和 resident key 是 discoverable credential 的历史旧称,已不建议使用。API 为兼容性保留 residentKey 和 requireResidentKey;它们不是另一种技术。residentKey 表示 RP 的要求:discouraged 优先服务器端凭据,但接受可发现凭据;preferred 强烈偏好可发现凭据,但接受服务器端凭据;required 必须创建可发现凭据,否则客户端报错。preferred 不保证结果。requireResidentKey 是旧布尔字段,只有在 residentKey 为 required 时才 SHOULD 设置为 true。可发现性与同步、platform/roaming 接入方式和用户验证彼此独立。阅读旧代码时应检查具体取值、库版本和注册结果,不要仅凭 resident 一词推断行为。
Sources
[W3C Web Authentication: An API for accessing Public Key Credentials, Level 3, §§4 and 5.4.4–5.4.6](https://www.w3.org/TR/webauthn-3/)