To enroll multiple authentication factors you need call Keyless.enroll for each factor.
Authentication with PIN
To authenticate using the PIN factor create the following configuration:
val configuration = PinAuthConfig(pin = "1234")
Keyless.authenticate(
configuration = configuration,
onCompletion = { /*TODO: process result*/ }
)
let configuration = PinAuthConfig(pin: "1234")
Keyless.authenticate(
configuration: configuration,
onCompletion: { /*TODO: process result*/ }
)
val configuration = AuthenticationConfiguration.builder
.withPin("1234")
.build()
Keyless.authenticate(
configuration = configuration,
onCompletion = { /*TODO: process result*/ }
)
let configuration = Keyless.AuthenticationConfiguration.builder
.withPin("1234")
.build()
Keyless.authenticate(
configuration: configuration,
onCompletion: { /*TODO: process result*/ }
)
final configuration = PinAuthConfig(
pin: "1234"
);
try {
final result = await Keyless.instance.authenticate(configuration);
print("Authentication successful");
} catch (error) {
print("Authentication failed: $error");
}
De-enrollment with PIN
Note that de-enrolling deletes the user biometric factor as well as the PIN factor. If you just want to remove the PIN authentication factor, use the PIN utilities instead.
To de-enroll using the PIN authentication factor, create the following configuration:
val configuration = PinDeEnrollConfig(pin = "1234")
Keyless.deEnroll(
configuration = configuration,
onCompletion = { /*TODO: process result*/ }
)
let configuration = PinDeEnrollConfig(pin: "1234")
Keyless.deEnroll(
configuration: configuration,
onCompletion: { /*TODO: process result*/ }
)
val configuration =
DeEnrollmentConfiguration.builder
.withPin("myPin")
.build()
Keyless.deEnroll(
configuration = configuration,
onCompletion = { /*TODO: process result*/ }
)
let configuration =
Keyless.DeEnrollmentConfiguration.builder
.withPin("myPin")
.build()
Keyless.deEnroll(
configuration: configuration,
onCompletion: { /*TODO: process result*/ }
)