How py_webauthn handles data transmission
masterWhen implementing a Relying Party (RP) with this library, follow these data handling patterns:
- Server to Webpage: Use JSON to transmit registration and authentication options. Because
bytescannot be transmitted directly in JSON, useoptions_to_json()to encodebytesvalues intobase64urlformat. This ensures compatibility withnavigator.credentials.create()andnavigator.credentials.get(). - Webpage to Server: Use JSON to transmit WebAuthn responses from the browser. The library can automatically parse these using
parse_registration_credential_jsonandparse_authentication_credential_json(which handlebase64urlencodedArrayBuffervalues). - Server-side Storage: Arguments defined as
bytesin the library's methods are intended to be stored entirely on the server. You can store these as rawbyteswithout extra encoding/decoding unless your specific storage implementation requires it.