To decode the AuthenticatorAttestationResponse
: attestationObject
property returned when attestationType: 'direct'
is passed to .create()
, this works:
const {decodeAllSync} = require("cbor");
// ...
const att1 = decodeAllSync(credential.response?.attestationObject, {required: true, encoding: 'base64url'})[0]
However, when I do the same for the authenticatorData
const data = decodeAllSync(credential.response?.authenticatorData, {required: true, encoding: 'base64url'})[0];
I get this error, whatever platform created the credential:
TypeError The encoded data was not valid for encoding utf-8 ERR_ENCODING_INVALID_ENCODED_DATA
I’m using Node 18, if that matters.
How should I go about decoding ‘.authenticatorData’ ?