Repository navigation
fix(biometric) Incorrect error reported on Android with no device passcode set and fallback allowed - #2648
Conversation
…PI >= `Build.VERSION_CODES.R`
|
Made a slight oversight in my first solution where I put ALL the code dealing with setting the Fixed the issue by reverting most of the code and using a separate variable to hold the supplied |
Package Changes Through 756ea36There are 9 changes which include deep-link with patch, deep-link-js with patch, biometric with patch, biometric-js with patch, fs with patch, fs-js with patch, single-instance with patch, updater with minor, updater-js with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
… Android prompt Replaces the override of ERROR_NO_BIOMETRICS in the prompt callback, which keyed on the caller's flag rather than the device state and missed the no-hardware errors.
Describe the problem
When performing biometric authentication on Android with no biometry or device credential set, but fallback credential allowed, the error
biometryNotEnrolledis reported. While this error is technically correct, the expected error would bepasscodeNotSet, closer matching the actual error and the behavior of other platforms.Steps to reproduce
In my case, I tested this using the
examples/apiapp, but general reproduction steps are as follows:allowDeviceCredentialset to truebiometryNotEnrolledas opposed topasscodeNotSetCause
In my testing, I found that the following seem to be the cause of the issue:
manager.isDeviceSecurereturns false that prevents settingAuthenticators.DEVICE_CREDENTIALas a valid authenticator -- This is actually intended behavior and isn't the root cause as seen nextERROR_NO_BIOMETRICSeven after allowing device credential on an insecure device (manager.isDeviceSecure == false). It seems this is the intended behavior of the Android API, but nevertheless should be corrected in the biometric plugin aspasscodeNotSetmore accurately describes the error.Proposed solution
Override the error code and message to
ERROR_NO_DEVICE_CREDENTIALin the event that a fallback credential is allowed, but error codeERROR_NO_BIOMETRICSwas received.Additional notes
Also corrected the Android module mapping
ERROR_NO_DEVICE_CREDENTIALtonoDeviceCredentialwhen it should bepasscodeNotSet.