Menu

Decoding WebAuthn Passkey CBOR (attestationObject, authenticatorData, COSE Keys) Without a Backend
πŸ“°

Decoding WebAuthn Passkey CBOR (attestationObject, authenticatorData, COSE Keys) Without a Backend

DEV Community: authenticationΒ·Jason Y. (dev_in_the_fog)Β·14 days ago
#qfv8EZAW
#devtoauthentication#devto#dev#byte#cbor
Long article (310 words) β€” no AI summary yet.
Reading 0:00
15s threshold

When implementing Passkeys (WebAuthn), navigator.credentials.create() hands back an opaque Base64URL-encoded CBOR blob called attestationObject . When a server verifier rejects a registration with RP ID hash mismatch , UV flag not set , or Unsupported COSE algorithm , console.log alone does not tell you which byte failed.

Here is the exact binary layout to inspect before blaming your server library.

1. Unwrapping attestationObject

After Base64URL-decoding response.attestationObject , the CBOR map contains three keys:

fmt β€” attestation statement format ( "none" , "packed" , "apple" , "tpm" )

attStmt β€” attestation signature map

authData β€” raw authenticatorData byte buffer

2. The 37-Byte authenticatorData Header

Every WebAuthn registration and assertion starts with the same 37 bytes:

Bytes 0..31 (32B): SHA-256(rpId) β€” must match your configured Relying Party ID (e.g.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.