New Device Activation
This page explains how to then use the temporary state to then authenticate the user and bind the new device to then support ongoing 2 factor authentication.
Recover from temporary state
Pass the temporary state created during the enrollment flow or via IDV Bridge to recover the account on a new device. The temporary state is the one you obtained and stored securely when enrolling users via IDV Bridge or the Mobile SDK on the previous sub-page
// temporaryState retrieved from previous step
val temporaryState = "<your_temporary_state>"
val enrollConfig = BiomEnrollConfig(temporaryState = temporaryState)
Keyless.enroll(
configuration = enrollConfig,
onCompletion = { result ->
when (result) {
is Keyless.KeylessResult.Success -> {
// account recovered
val userId = result.value.userId
}
is Keyless.KeylessResult.Failure -> Log.d("KeylessSDK ", "error code ${result.error.code}")
}
}
)
// temporaryState retrieved from previous step
let temporaryState = "<your_temporary_state>"
let enrollConfig = BiomEnrollConfig(temporaryState: temporaryState)
Keyless.enroll(
configuration: enrollConfig,
onCompletion: { result in
switch result {
case .success(let enrollSuccess):
// account recovered
let userId = enrollSuccess.userId
case .failure(let error):
print("error code: \(error.code)
}
})import 'package:keyless_flutter_sdk/keyless.dart';
import 'package:keyless_flutter_sdk/models/configurations/enrollment_configuration.dart';
// temporaryState retrieved from previous step
final temporaryState = "<your_temporary_state>";
final enrollConfig = BiomEnrollConfig(temporaryState: temporaryState);
try {
final result = await Keyless.instance.enroll(enrollConfig);
// account recovered
print("Account recovered successfully. UserID: ${result.keylessId}");
} catch (error) {
print("Account recovery failed: $error");
}The account is recovered and it's now possible to authenticate the user with ongoing 2 factor authentication with a single
Last updated
Was this helpful?