duo-labs / py_webauthn

Pythonic WebAuthn 🐍
https://duo-labs.github.io/py_webauthn
BSD 3-Clause "New" or "Revised" License
856 stars 171 forks source link

what is credential_public_key? #189

Closed LinoVallebuona closed 9 months ago

LinoVallebuona commented 11 months ago

So I want to use webauthn in python to authenticate a passkey on my website. But I don't understand wich publicCredentialKey i should use. There is a public key I can get wirh response.getPublicKey() and there is a CredentialPublicKey but thats just the JSON object with the ArrayBuffers of credential id etc. How do I get this credential public key? Or is it just a base64 encoded Version of something?

MasterKale commented 9 months ago

The credential_public_key argument that you specify when calling verify_authentication_response() will most reliably work with the value of VerifiedRegistration.credential_public_key that is returned from verify_registration_response():

https://github.com/duo-labs/py_webauthn/blob/a3fb0a53869e51a29c92fd1aea0c9f3e6d34be6a/webauthn/registration/verify_registration_response.py#L279