Generating client state via the Mobile SDK
This page explains how to create a client state during a Keyless Enrollment or Authentication, which can then be leveraged for binding a user on a new device.
What is the client state?
"{\"artifact\":{\"family\":\"davideface_lite\",\"version\":\"1.2.0\",\"target\":\"mobile_sdk\",\"liveness\":\"liveness\"},\"core-client-state\":\"BASE_64_STATE\"}"Obtain the client state
val enrollConfig = BiomEnrollConfig(generatingClientState = ClientStateType.BACKUP)
Keyless.enroll(
configuration = enrollConfig,
onCompletion = { result ->
when (result) {
is Keyless.KeylessResult.Success -> {
val clientState = result.value.clientState
// store the client state on your backend to recover the account in the future
}
is Keyless.KeylessResult.Failure -> Log.d("KeylessSDK ", "error code ${result.error.code}")
}
}
)
val authConfig = BiomAuthConfig(generatingClientState = ClientStateType.BACKUP)
Keyless.authenticate(
configuration = authConfig,
onCompletion = { result ->
when (result) {
is Keyless.KeylessResult.Success -> {
val clientState = result.value.clientState
// store the client state on your backend to recover the account in the future
}
is Keyless.KeylessResult.Failure -> Log.d("KeylessSDK ", "error code ${result.error.code}")
}
}
)Last updated
Was this helpful?