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 requiredpublicKeyCredentialCreationOptionsparameter is missing from the JSON.Declaration
Swift
required public init(with json: [String : Any])Parameters
jsonThe 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
nilif registration has not been completed. -
register(window:Asynchronous) Initiates the FIDO registration process using async/await.
This method uses the
fido.registermethod to perform the registration ceremony. On success, it constructs and stores theattestationValue, 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
windowThe
ASPresentationAnchorto present the FIDO UI.Return Value
A dictionary representing the
attestationValue.
View on GitHub