node.js - Webauthn - Windows Hello 验证器选择不起作用

标签 node.js webauthn password-less

我正在开发一个示例 Node js 应用程序来在 Windows 10 上使用 webauthn。

        challenge: challenge,
        rp: {
            name: "Example CORP",
            id  : "localhost"
        },
        user: {
            id: new Uint8Array(16),
            name: "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="acc6c8c3c9ecc9d4cdc1dcc0c982cfc3c1" rel="noreferrer noopener nofollow">[email protected]</a>",
            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

我还缺少任何其他参数吗?

-- 湿婆

最佳答案

您没有在 authenticatorSelection 对象中定义 userVerification 属性。

来自 W3.org :

Let userVerification be the effective user verification requirement for the assertion:

is set to required Let userVerification be true.

is set to discouraged Let userVerification be false.

is set to preferred If the authenticator is capable of user verification Let userVerification be true. if the authenticator not capable of user verification Let userVerification be false.

authenticatorSelection: {
  authenticatorAttachment: "platform",
  userVerification: "required" 
},

关于node.js - Webauthn - Windows Hello 验证器选择不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69611717/

相关文章:

javascript - 在 express js 的不同文件中访问相同的数据库连接实例

java - 是否可以在javascript中反序列化java对象

javascript - 如何排除 TypeScript 定义中声明的全局类型?

image - Node.js Base64 图像解码和写入文件

ios - 如何在 iOS 上启用指纹 WebAuthn

node.js - 无密码和 mongostore

Firebase Fido2 身份验证支持

javascript - WebAuthN 是否可以查看可用的平台验证器?

javascript - Node 无密码发送每个 token 请求的动态正文