Fido
@MainActor
public class Fido : NSObject, ASAuthorizationControllerDelegate, ASAuthorizationControllerPresentationContextProviding
Fido is a class that provides FIDO registration and authentication functionalities.
-
The shared singleton FIDO instance.
Declaration
Swift
@MainActor public static let shared: Fido -
Registers a new FIDO credential.
Declaration
Swift
@MainActor public func register(options: [String : Any], window: ASPresentationAnchor, completion: @escaping (Result<[String : Any], Error>) -> Void)Parameters
optionsA dictionary containing the registration options.
windowThe window to present the registration UI in.
completionA closure to be called with the registration result.
-
Authenticates with an existing FIDO credential.
Declaration
Swift
@MainActor public func authenticate(options: [String : Any], window: ASPresentationAnchor, completion: @escaping (Result<[String : Any], Error>) -> Void)Parameters
optionsA dictionary containing the authentication options.
windowThe window to present the authentication UI in.
completionA closure to be called with the authentication result.
-
Declaration
Swift
@MainActor public func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchorReturn Value
The presentation anchor.
-
Handles the successful completion of an authorization request.
Declaration
Swift
@MainActor public func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization)Parameters
controllerThe authorization controller.
authorizationThe authorization object containing the credential.
-
Handles the completion of an authorization request with an error.
Declaration
Swift
@MainActor public func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error)Parameters
controllerThe authorization controller.
errorThe error that occurred.
View on GitHub