Biometric Authentication
If the physical device supports biometric authentication it can be used to authenticate into a Device and to decide Operations
Enable Biometric authentication
- iOS (Swift)
- Android (Java)
//context: must be previously authenticated
trustFactorClient.enableBiometricAuthentication(pin: <String>, context: <LAContext>) { result, correlationId in
switch result {
case .failure(let error):
// handle error
case .success(_):
// handle success
}
}
//context: must be previously authenticated
trustFactorClient.enableBiometricAuthentication(pin: <String>, cipher: <Cipher>, new Result<Boolean, Error>() {
@Override
public void onSuccess(Boolean value, String correlationId) {
// value is a boolean we can ignore
}
@Override
public void onFailure(Error error, String correlationId) {
// handle errors
}
});
Authenticate
- iOS (Swift)
- Android (Java)
trustFactorClient.authenticate(context: <LAContext>) { result, correlationId in
switch result {
case .failure(let error):
// handle error
case .success(_):
// handle success
}
}
trustFactorClient.authenticate(cipher: <Cipher>, new Result<TFAuthenticationResponse, Error>() {
@Override
public void onSuccess(TFAuthenticationResponse value, String correlationId) {
// handle success
}
@Override
public void onFailure(Error error, String correlationId) {
// handle errors
}
});
Disable
Disabling biometric authentication does not require the Device to be authenticated but it's important to update the device as soon as the user authenticates via PIN.
- iOS (Swift)
- Android (Java)
try trustFactorClient.disableBiometricAuthentication()
trustFactorClient.disableBiometricAuthentication(new Result<Boolean, Error>() {
@Override
public void onSuccess(Boolean value, String correlationId) {
// value is a boolean we can ignore
}
@Override
public void onFailure(Error error, String correlationId) {
// handle errors
}
});