react-native-keychain
react-native-keychain copied to clipboard
canImplyAuthentication incorrectly returns true
Hi
I have encountered an issue using the accessControl option on an iOS device with passcode enabled and Touch ID not enrolled:
// Passcode enabled and Touch ID not enrolled
const canImplyAuthentication = await Keychain.canImplyAuthentication({
accessControl: Keychain.ACCESS_CONTROL.BIOMETRY_ANY_OR_DEVICE_PASSCODE,
// or
// accessControl: Keychain.ACCESS_CONTROL.BIOMETRY_ANY,
}); // returns `true`
const setPasswordResult = await Keychain.setGenericPassword(username, password, {
accessControl,
}); // immediately throws "Error: The user name or passphrase you entered is not correct."
I believe in this specific case canImplyAuthentication should return false, no?
Update: calling Keychain.getSupportedBiometryType(); correctly returns null when Touch ID is not enrolled and 'TouchID' when it is.
Details:
- iOS 14.8.1
- iPhone 8