Enrollment
During the enrollment, the user's face is processed and the provided token is securely stored in the Keyless network. In the process a unique user identifier is also generated.
Depending on your application logic, you can choose to use different tokens. This could be a secret that you have provided to the app from the backend, the seed of an OTP protocol, or anything else. If you only need to know just the result of the authentication (success/failed), you can provide any constant value as token.
Android
iOS
1
val configuration = EnrollmentConfiguration.builder
2
// custom token is required
3
.withCustomToken("myToken")
4
// device info is optional
5
.withDeviceInfo("device-name")
6
// operation info is optional (same "operation_id" cannot be re-used)
7
.withOperationInfo(operationId = "operation_id", payload = "your payload")
8
// number of enrollment circuits is optional
9
.withNumberOfEnrollmentCircuits(5)
10
.build()
11
12
Keyless.enroll(
13
enrollmentConfiguration = configuration,
14
onCompletion = { result ->
15
when (result) {
16
is Keyless.KeylessResult.Success -> Log.d("KeylessSDK ", "Enroll success - userId ${result.value.keylessId}")
17
is Keyless.KeylessResult.Failure -> Log.d("KeylessSDK ", "Enroll failure - error code ${result.error.code}")
18
}
19
}
20
)
Copied!
1
let configuration = Keyless.EnrollmentConfiguration.builder
2
// custom token is required
3
.withCustomToken("myToken")
4
// device info is optional
5
.withDeviceInfo("device-name")
6
// operation info is optional (same "operation_id" cannot be re-used)
7
.withOperationInfo(id: "operation_id", payload: "your payload")
8
// number of enrollment circuits is optional
9
.withNumberOfEnrollmentCircuits(5)
10
.build()
11
12
Keyless.enroll(
13
enrollmentConfiguration: configuration,
14
onProgress: { progress in
15
print("Enrollment progress: \(progress)")
16
},
17
onCompletion: { result in
18
switch result {
19
case .success(let enrollmentSuccess):
20
print("Enrollment finished successfully. UserID: \(enrollmentSuccess.keylessId)")
21
case .failure(let error):
22
print("Enrollment finished with error: \(error.message)
23
}
24
})
Copied!
Enrollment parameters
It is possible to specify enrollment parameters using the EnrollmentConfiguration builder.

Custom token

Using the withCustomToken method it is possible to specify the ascii string that will be securely stored in the Keyless network. The same string will be returned after a successful authentication.

Device info

Using the withDeviceInfo method it is possible to specify any additional information related to the device. This information is encrypted and could be decrypted only by the user's devices.

Backup Restore

Only in case you are restoring a backup that you previously performed with Keyless, you can use withBackup instead of withCustomToken. You will need to pass the backupKey and backupData as parameters.
Note that withBackup and withCustomToken are mutually exclusive

Operation info

Using the withOperationInfo method it is possible to specify an id string and a payload string that will be stored on the Keyless backend if the authentication is succeeded. Details on how to query our backend for stored operations are availabe on Operation Confirmation API.

Liveness Settings

Using withLivenessSettings you can specify the liveness security level with LivenessConfiguration and a timeout to perform the liveness.

Retrieve backup

Using retrievingBackup in the builder you can specify whether you want to receive the backup data in the result of the enroll. When enabling the retrievingBackup flag you will find a KeylessBackup in the result.
Export as PDF
Copy link
Contents