Problem
On iOS, in case of a native errSecAuthFailed error, BiometricStorageFile (read or write) doesn't map the native error to an AuthException. Instead a PlatformException is thrown:
PlatformException(SecurityError, Error while Error retrieving item. -25293: -25293: La phrase secrète ou le nom d’utilisateur saisi n’est pas valide., null, null)
This makes it hard to handle the error properly. It requires parsing the PlatformException's message instead of simply relying on AuthException.
Precondition
This error can occur when StorageFileInitOptions(darwinBiometricOnly: true) and:
- A user has set up a
BiometricStorageFile with functioning biometrics setup
- User changes their biometrics settings, e.g.: Disabling biometrics, removing biometrics permission from app, or adding a fingerprint.
- User tries to access the
BiometricStorageFile with the new biometrics setup
Expected Behaviour
A new case AuthException.biometricsChanged (or similar) is returned. No exception is thrown.
Problem
On iOS, in case of a native errSecAuthFailed error,
BiometricStorageFile(readorwrite) doesn't map the native error to anAuthException. Instead aPlatformExceptionis thrown:This makes it hard to handle the error properly. It requires parsing the
PlatformException's message instead of simply relying onAuthException.Precondition
This error can occur when
StorageFileInitOptions(darwinBiometricOnly: true)and:BiometricStorageFilewith functioning biometrics setupBiometricStorageFilewith the new biometrics setupExpected Behaviour
A new case
AuthException.biometricsChanged(or similar) is returned. No exception is thrown.