node.js - Webauthn - Windows Hello 身份验证器选择不起作用
问题描述
我只是在开发一个示例节点 js 应用程序来在 Windows 10 上玩 webauthn。
challenge: challenge,
rp: {
name: "Example CORP",
id : "localhost"
},
user: {
id: new Uint8Array(16),
name: "jdoe@example.com",
displayName: "John Doe"
},
pubKeyCredParams: [
{
type: "public-key",
alg: -7
}
],authenticatorSelection: {
authenticatorAttachment: "platform" //cross-platform is working fine
},
timeout: 60000
};
const credential = navigator.credentials.create({
publicKey: publicKey
});
我确实得到了以下错误,并且没有看到任何 Windows Hello 模式窗口。
login:32 publicKey.authenticatorSelection.userVerification was not set to any value in Web Authentication navigator.credentials.create() call. This defaults to 'preferred', which is probably not what you want. If in doubt, set to 'discouraged'. See https://chromium.googlesource.com/chromium/src/+/master/content/browser/webauth/uv_preferred.md for details
我还缺少任何其他参数吗?
——湿婆
解决方案
您没有在对象中定义userVerification
属性。authenticatorSelection
来自W3.org:
令
userVerification
为断言的有效用户验证要求:
设置为必需 让
userVerification
为真。
设置为不鼓励 让
userVerification
为假。
设置为首选 如果身份验证器能够进行用户验证,则
userVerification
设为 true。如果身份验证器无法进行用户验证,userVerification
则设为 false。
authenticatorSelection: {
authenticatorAttachment: "platform",
userVerification: "required"
},
推荐阅读
- angular - 组件组成 - 验证问题
- asp.net-core - favicon.ico 503 文本/html
- c++ - 使用指针和向量时没有运算符匹配“*”错误
- docker - 为什么我必须定期使用 `docker network prune` 来重新启用容器内的 docker 映射 ip 连接?
- android - MotionLayout 和 Horizontal Recyclerview
- android - Android 铬错误
- kotlin - Kotlin 多类数据存储
- amazon-ec2 - 在 ec2 中强制标记
- java - 使用 Android Intent 共享文件:文件扩展名已删除
- r - 提取 div#data-old-hires 中后续图像的链接