Skip to main content

BIDAuthProvider

public class BIDAuthProvider

This class is responsible for managing different authentication types, i.e., a device's biometric (fingerprint, face, pin, password, pattern lock), pin & Live ID.

Enum Values​

AuthAssetType
deviceA value to work with device authentication (hardware fingerprint, face, password or pin) method.
liveIDA value to work with the Live ID authentication method.
pinA value to work with Pin authentication method. The Pin is specific to app created to lock/ unlock the application.
BiometricError
NoIDNo biometric ID enrolled.
cancelBiometric enrollment canceled.
lockoutBiometric enrollment locked.
notAvailableBiometric enrollment is not available.
notEnrolledBiometrics are not enrolled
passwordFallback to password.

Field Summary​

Parameter
static BIDAuthProvidersharedSingleton instance of BIDAuthProvider

Method Summary​

Parameter
voidenrollDeviceAuth(allowReEnrollment: Bool = false, completion: @escaping (Bool, Any?, String?) -> Void)Registers device's biometric
StringgetLiveIdImageBase64String() -> String?Returns registered LiveID base64 image
voidinitialize()Initializes BIDAuthProvider
BoolisAuthAssetEnrolled(assetType: AuthAssetType)Checks and indicates if the given type of authentication asset is registered
BoolisSDKUnLocked()Checks and indicates if the SDK is locked or not
voidlockSDK()Locks the SDK
voidunenrollDeviceAuth(completion: @escaping (Bool, Any?, String?) -> Void)Removes the registered device's biometric (fingerprint, face, pin, password, pattern lock)
voidunlockSDK()Unlocks the SDK
voidverifyDeviceAuth(completion: @escaping (Bool, BiometricError?, String?) -> Void)Verifies the application using device's biometric authentication. Provides an option to fallback to Pin authentication in case biometric verification is failed
voidverifyFace(image: UIImage, keyPair: APIKeyPair, tenant: BIDTenant, did: String, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping (_ status: Bool, _ error: ErrorResponse?) -> Void)Compares the given face with the one stored in vault and returns the result. This method is generally used for document enrollment purpose.
BoolverifyPin(pin: String)Checks and indicates pin verification result. The given pin is verified with the one stored in vault

Method Details​

enrollDeviceAuth​

tip

You must add the NSFaceIDUsageDescription key to your application's info.plist file.

public func enrollDeviceAuth(allowReEnrollment: Bool = false, completion: @escaping (Bool, Any?, String?) -> Void)

  • Registers device's biometric (fingerprint, face, pin, password, pattern lock).
Parameter
allowReEnrollmentBool: Re-enroll Biomatric when device Biomatric changed
completion@escaping (Bool, Any?, String?) -> VoidThe block to execute after the device authentication enrollment response is received

getLiveIdImageBase64String​

public func getLiveIdImageBase64String() -> String?

  • Returns registered LiveID base64 image

initialize​

public func initialize()

  • Initializes BIDAuthProvider.

isAuthAssetEnrolled​

public func isAuthAssetEnrolled(assetType: AuthAssetType) -> Bool

  • Checks and indicates if the given type of authentication asset is registered.
Parameter
assetTypeAuthAssetType

isSDKUnLocked​

public func isSDKUnLocked() -> Bool

  • Checks and indicates if the SDK is locked or not.

lockSDK​

public func lockSDK()

  • Locks the SDK.

unEnrollDeviceAuth​

public func unenrollDeviceAuth(completion: @escaping (Bool, Any?, String?) -> Void)

  • Removes the registered device's biometric (fingerprint, face, pin, password, pattern lock).
Parameter
completion@escaping (Bool, Any?, String?) -> VoidThe block to execute after the device authentication unenrollment response is received

unlockSDK​

public func unlockSDK()

  • Unlocks the SDK.

verifyDeviceAuth​

public func verifyDeviceAuth(completion: @escaping (Bool, BiometricError?, String?) -> Void)

  • Verifies the application using the device's biometric authentication. Provides an option to fall back to Pin authentication in case biometric verification is failed.
Parameter
completion@escaping (Bool, Any?, String?) -> VoidThe block to execute after the device authentication verification response is received

verifyFace​

public func verifyFace(image: UIImage, keyPair: APIKeyPair, tenant: BIDTenant, did: String, mobileSessionId: String? = nil, mobileDocumentId: String? = nil, completion: @escaping (_ status: Bool, _ error: ErrorResponse?) -> Void)

  • Compares the given face with the one stored in the vault and returns the result. This method is generally used for document enrollment purposes.
Parameter
imageImageAn image of face to be verified
keyPairAPIKeyPairThe API key pair
tenantBIDTenantTenant details
didStringApplication's DID
mobileSessionIdString: (Optional) Unique Session ID that can be used for event tracking or validation purposes.
mobileDocumentIdString: (Optional) Unique Document ID that can be used for event tracking or validation purposes.
completion@escaping (_ status: Bool, _ error: ErrorResponse?) -> VoidThe block to execute after the face verification response is received

verifyPin​

public func verifyPin(pin: String) -> Bool

  • Checks and indicates pin verification result. The given pin is verified with the one stored in the vault.
Parameters
pinStringpin to verify against the vault pin.