github / webauthn-json

🔏 A small WebAuthn API wrapper that translates to/from pure JSON using base64url.
https://github.github.com/webauthn-json/demo/
MIT License
760 stars 61 forks source link

How can I access the attestationObject? #66

Closed drewcapener closed 2 years ago

drewcapener commented 2 years ago

Sorry if this is straightforward and I've missed the explanation in the documentation, but I am unsure how to decode the attestationObject on my server. I was able to decode the clientDataObject with Buffer.from(credential.response.clientDataJSON, 'base64url').toString('ascii') but the same doesn't seem to work with the attestationObject. It appears the attestationObject is also CBOR encoded. So, I tried decoding from base64url and then from CBOR but that didn't work. Anyway, I'd appreciate any help I can get here. Thanks in advance!

lgarron commented 2 years ago

This library is specifically only meant to address JSON serialization on the client side, so I can't really be of much help.

You might find some the libraries listed at https://webauthn.io/ helpful. If you want a single library that also provides server functionality, you may want to consider https://github.com/MasterKale/SimpleWebAuthn as well.

Let me know if that helps.

lgarron commented 2 years ago

Closing this for now; let us know if you have more issues.