fido2.payment

Classes

CollectedClientAdditionalPaymentData

A data class with members also accessible as a JSON-serializable Mapping.

CollectedClientPaymentData

bytes(iterable_of_ints) -> bytes

PaymentClientDataCollector

ClientDataCollector for the WebAuthn "payment" extension.

Module Contents

class fido2.payment.CollectedClientAdditionalPaymentData[source]

Bases: fido2.utils._JsonDataObject

A data class with members also accessible as a JSON-serializable Mapping.

rp_id: str
top_origin: str
payee_name: str | None = None
payee_origin: str | None = None
total: fido2.ctap2.extensions.PaymentCurrencyAmount
instrument: fido2.ctap2.extensions.PaymentCredentialInstrument
class fido2.payment.CollectedClientPaymentData(serialized)[source]

Bases: fido2.webauthn.CollectedClientData

bytes(iterable_of_ints) -> bytes bytes(string, encoding[, errors]) -> bytes bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer bytes(int) -> bytes object of size given by the parameter initialized with null bytes bytes() -> empty bytes object

Construct an immutable array of bytes from:
  • an iterable yielding integers in range(256)

  • a text string encoded using the specified encoding

  • any object implementing the buffer API.

  • an integer

Parameters:

serialized (bytes)

payment: CollectedClientAdditionalPaymentData
classmethod create(type, challenge, origin, cross_origin=False, **kwargs)[source]
Parameters:
Return type:

fido2.webauthn.CollectedClientData

class fido2.payment.PaymentClientDataCollector(origin, verify=verify_rp_id)[source]

Bases: fido2.client.DefaultClientDataCollector

ClientDataCollector for the WebAuthn “payment” extension.

This class can be used together with the CTAP2 “thirdPartyPayment” extension to enable third-party payment confirmation. It collects the necessary client data and validates the options provided by the client.

Parameters:
collect_client_data(options)[source]

Called when the client is preparing a request.

Should return a CollectedClientData object with the client data for the request, as well as the RP ID of the credential.