FRWebAuthnManager

@available(iOS 16, *)
public class FRWebAuthnManager : NSObject, ASAuthorizationControllerPresentationContextProviding, ASAuthorizationControllerDelegate

FRWebAuthnManager is a class handling WebAuthn Registation and Authentication using Apple’s ASAuthorization libraries. Used by the SDK, it is called by the WebAuthnRegistration and WebAuthnAuthenticaton callbacks and sets the outcome in the HiddenValueCallback. This comes with the FRWebAuthnManagerDelegate that offers callbacks in the calling class for Success, Error and Cancel scenarios.

  • Declaration

    Swift

    public weak var delegate: FRWebAuthnManagerDelegate?
  • Declaration

    Swift

    public init(domain: String, authenticationAnchor: ASPresentationAnchor?, node: Node)
  • Sign In method, using AuthenticationServices. This will use the stored Passkeys to create the challenge and set it in tghe HiddenValue callback. Called by the WebAuthnAuthentication callback, by triggering the func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) delegate method.

    Declaration

    Swift

    public func signInWith(preferImmediatelyAvailableCredentials: Bool, challenge: Data, allowedCredentialsArray: [[UInt8]], userVerificationPreference: ASAuthorizationPublicKeyCredentialUserVerificationPreference)

    Parameters

    preferImmediatelyAvailableCredentials

    set to True to use only local keys

    challenge

    challenge Data as received from the Node

    allowedCredentialsArray

    Allowed credentials

  • Sign un method, using AuthenticationServices. This create the Passkey and store it in the Keychain, by triggering the func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) delegate method.

    Declaration

    Swift

    public func signUpWith(userName: String, challenge: Data, userID: String, deviceName: String?, userVerificationPreference: ASAuthorizationPublicKeyCredentialUserVerificationPreference, attestationPreference: ASAuthorizationPublicKeyCredentialAttestationKind)

    Parameters

    userName

    username

    challenge

    challenge Data as received from the Node

    userID

    userID

    deviceName

    Optional device name. This will be the device name, that appears in the list of user devices

ASAuthorizationControllerPresentationContextProviding

  • Declaration

    Swift

    public func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor

ASAuthorizationControllerDelegate