Authentication is the biometric equivalent of "signing-in". During authentication Keyless compares the user's facial biometrics with the ones computed during enrollment.
If the biometrics match, Keyless authenticates the user.
let configuration = Keyless.AuthenticationConfiguration.builder.build()Keyless.authenticate( authenticationConfiguration: configuration, onCompletion: { result inswitch result {case .success(let success): print("Authentication success")case .failure(let error):break } })
Authentication configuration
You can configure the authentication process with optional parameters in your BiomAuthConfig() instance or using the builder pattern methods from the AuthenticationConfiguration builder.
Backup data is no longer recommended to perform account recovery use the temporary state. Follow the guide on account recovery.
Keyless can generate backup data that you can use to recover an account.
To create the backup data use the shouldRetrieveBackup configuration parameter. Once authentication succeeds, copy the backup data from the AuthenticationSuccess result, and store it securely.
To recover an account, use backup parameter during enrollment more in backup.
Camera Delay
Use cameraDelaySeconds to specify the delay (in seconds) between when the camera preview appears, and when the liveness processing starts.
Custom Secret
If you saved a custom secret during enrollment, you can retrieve it using the shouldRetrieveSecret parameter.
Keyless will populate the field customSecret in the AuthenticationSuccess result.
JWT Signing info
You can specify a payload to be added to a JWT signed by Keyless with the jwtSigningInfo parameter, more in JWT signing.
Liveness Settings
Using livenessConfiguration you can configure the liveness security level during enrollment. The possible liveness configuration are under LivenessSettings.LivenessConfiguration :
You can also specify a livenessTimeout (in seconds) to cancel the enrollment if the liveness takes longer than the timeout.
More details on liveness in the dedicated liveness settings section.
Operation info
The parameter operationInfo specifies a customizable unique operation identifier and associated payload stored on the Keyless backend if the enrollment succeeds.
Details on how to query our backend for stored operations are available on Operations API.
Success Animation
Using the successAnimation you can specify whether the Keyless SDK should display a checkmark indicating a successful authentication to the user.
Temporary State
Use the shouldRetrieveTemporaryState parameter to creata a temporary state useful for the account recovery.