Having trouble with implementing WebAuthn support on a new website, specifically encountering issues during the navigator.credentials.get() call. The client browser being used is Firefox 85.0 on Fedora 33, and the server is Apache httpd also on Fedora 33. The authentication token in use is either a Yubikey 4 or a Yubikey 5NFC (with consistent results). Below is the function responsible for making the API call, with test-specific credential IDs:
function handleUserAuthenticationResponse(r) {
var cid1 = {type: "public-key", id: base64ToArrayBuffer("gL0Ig10uA2tn8L0kn2L9FoGqIPSrqvc1lLBwgQhcVDa200b1P94kPv94T6O1bDZyYRrfLbTrLRsubDxuYUxHCg==")};
var cid2 = {type: "public-key", id: base64ToArrayBuffer("tjW1RPqtAJm69I/qeV7eRFJx6h87J3NPeJ/hhbkjttcCc2BWHQ2v2nueoKBSGabw1eYsT8S+lhJv1l1mYWX+Uw==")};
// Rest of the code block...
After following the necessary steps, including the blinking LED signal from Yubikey and touchpad interaction, an exception is thrown:
Error fetching token assertion: DOMException: An attempt was made to use an object that is not, or is no longer, usable
This issue appears to be a generic Firefox error message that may relate to mismatched credentials or other factors. The FIDO2 credential stored on the Yubikey was generated using the fido2-cred(1) tool from libfido2 source, yielding this specific credential ID:
CuCEGL10uPhBmNCY4NsGaAz0gir/68UMGFQn0pfb6tc=
http://localhost
fido-u2f
// More data...
The investigation points towards the potential JS or credentials API misstep as the cause, but without clearer diagnostics, more steps are needed. Any insights or suggestions on resolving this would be greatly appreciated.
UPDATE: Attempted removing the scheme from RP ID as a troubleshooting step, but it did not yield any change in the outcome.
UPDATE: Further analysis of the source code indicates the error as NS_ERROR_DOM_INVALID_STATE_ERR, likely stemming from U2F_ERROR_INVALID_STATE, translating into numerical value 3. This leads to inquiries about the HID driver underpinning the Yubikey operations and its compatibility status. The quest for resolution continues...