WebAuthn credential transport:将连接方式作为提示使用
WebAuthn credential descriptor 中的 `transports` 列出客户端已知可能连接到某项凭据的通信方式,例如 `usb`、`nfc`、`ble`、`internal` 或 `hybrid`。这些提示不能证明凭据可信、属于谁或当前可用,因此不要单独将其作为访问控制依据。
WebAuthn credential transport:将连接方式作为提示使用
WebAuthn credential descriptor 中的 transports 列出客户端已知可能连接到某项凭据的通信方式,例如 usb、nfc、ble、internal 或 hybrid。这些提示不能证明凭据可信、属于谁或当前可用,因此不要单独将其作为访问控制依据。
本文介绍 W3C WebAuthn Level 3 的 AuthenticatorTransport 和 credential descriptor。浏览器、操作系统和认证器支持的值及行为可能不同。
transport 不等于 attachment
transports 帮助客户端查找并连接认证器。authenticatorAttachment 则单独报告成功操作使用的是平台认证器(platform),还是可跨设备使用的认证器(cross-platform)。transport 值不能确定 attachment 类型或备份资格。同一凭据可能通过多种方式访问;这些值不是强度评分。
如何处理这些提示
可以将注册时提供的 transport 提示与凭据记录一起保存。不要把未经验证的浏览器或用户输入提升为信任策略。
在登录请求的 `allowCredentials` 条目中加入已保存提示,可能帮助用户代理查找认证器。缺少某个值并不一定表示该方式不可用。
不要仅因提示未知或实际连接方式不同而拒绝认证。客户端成功后,RP 仍须验证 assertion,包括签名、challenge、origin 和 RP ID。
仅向用户展示已在受支持环境中确认可用的方式。不要推断“USB 就代表公司所有的认证器”。
参考资料
W3C, [Web Authentication Level 3: Authenticator Transport](https://www.w3.org/TR/webauthn-3/#enumdef-authenticatortransport)
W3C, [Web Authentication Level 3: Credential Descriptor](https://www.w3.org/TR/webauthn-3/#dictdef-publickeycredentialdescriptor)