Enrollment is the process of registering a new user by connecting their facial biometrics to a Keyless account. During this process, a full and unobstructed view of the user's face is required.
let configuration = Keyless.EnrollmentConfiguration.builder.build()Keyless.enroll( enrollmentConfiguration: configuration, onCompletion: { result inswitch result {case .success(let enrollmentSuccess): print("Enrollment finished successfully. UserID: \(enrollmentSuccess.keylessId)")case .failure(let error): print("Enrollment finished with error: \(error.message) } })
Enrollment builder methods
You can customize the enrollment process with optional methods from the EnrollmentConfiguration builder. The full EnrollmentConfiguration is available below:
During enrolment you can specify a custom secret to be saved and encrypted along with the user's biometric data using savingSecret method. The custom secret can be anything you can save as an ASCII string, such as a secret that you have provided to the app from the backend, the seed of an OTP protocol, or anything else.
Backup data
Keyless can generate backup data that you can use to recover an account.
To create the backup data use the retrievingBackup method. Once the enrollment succeeds, copy the backup data from the EnrollmentSuccess result, and store it securely.
To recover an account, use withBackup passing as parameter the backup data you stored previously.
Liveness Settings
Using withLivenessSettings you can specify the liveness security level during enrollment, choosing the options from LivenessConfiguration.
You can also specify a livenessTimeout (in seconds) to cancel the enrollment if the liveness takes longer than the timeout.
withOperationInfo specifies a customizable unique operation identifier and associated payload stored on the Keyless backend if the enrollment succeeds. Use this to add an extra level of confirmation in your operations.
Details on how to query our backend for stored operations are available on Operations API.
Enrollment Delay
Use withDelay to specify the delay (in seconds) between when the camera preview appears, and when the liveness processing starts.
Enrollment Selfie
Using withEnrollmentSelfie you can retrieve the image that Keyless uses to computes the facial biometrics of the user. The image can be found in the EnrollmentSuccess result.