FidoRegistrationCollector

public class FidoRegistrationCollector : AbstractFidoCollector, Closeable, @unchecked Sendable

A collector for FIDO registration within a DaVinci flow.

  • Resets the collector’s state by clearing the attestation value.

    Declaration

    Swift

    public func close()
  • The public key credential creation options provided by the server.

    Declaration

    Swift

    public var publicKeyCredentialCreationOptions: [String : Any]
  • The attestation value constructed after a successful registration. This value is sent to the server.

    Declaration

    Swift

    public var attestationValue: [String : Any]?
  • Initializes a new FIDO registration collector.

    Throws

    An error if the required publicKeyCredentialCreationOptions parameter is missing from the JSON.

    Declaration

    Swift

    required public init(with json: [String : Any])

    Parameters

    json

    The JSON payload from the server that includes the FIDO registration options.

  • The payload to be sent to the DaVinci server.

    Declaration

    Swift

    override public func payload() -> [String : Any]?

    Return Value

    A dictionary containing the attestation value, or nil if registration has not been completed.

  • register(window:) Asynchronous

    Initiates the FIDO registration process using async/await.

    This method uses the fido.register method to perform the registration ceremony. On success, it constructs and stores the attestationValue, then returns it.

    Throws

    An error if the registration process fails or the response is invalid.

    Declaration

    Swift

    @MainActor
    public func register(window: ASPresentationAnchor) async -> Result<[String : Any], Error>

    Parameters

    window

    The ASPresentationAnchor to present the FIDO UI.

    Return Value

    A dictionary representing the attestationValue.