在 FF 中使用 WebAuthn 时,为什么 navigator.credentials.get() 返回“DOMException:用户代理或平台不允许该请求...”

问题描述 投票:0回答:1

我正在尝试实现 WebAuthn,但在调用 navigator.credentials.get() 时,在我按下 Yubikey 上的按钮后,它总是返回

DOMException: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.
,即使在调用 navigator.credentials.create() 时它工作正常 我在 Ubuntu 上使用 Firefox 118.0.1

这是我调用它的 publicKey 的内容:

$("#loginButton").click(function() {
        const result = navigator.credentials.get({
            publicKey: {
                challenge: new Uint8Array([139, 66, 87, 64, 66, 25, 78, 
                    64, 66, 25, 87, 139, 64, 66, 25, 78]),
                rpId: "localhost",
            }],
                userVerification: "preferred",
            }

我期望它返回一个有效的承诺,但它返回一个无效的承诺并在控制台中给出错误

firefox webauthn yubico
1个回答
0
投票

aoeuaoeuaoeunstaoheusanoteuhasonteuhasonetuhaosetnuhaoestnuhaoesutnhaoseutnhaoeu

© www.soinside.com 2019 - 2024. All rights reserved.