biometric_storage
biometric_storage copied to clipboard
Getting unknown exception on android
After the read function and the fingerprint conformation i get - AuthException{code: AuthExceptionCode.unknown, message: Unexpected authentication error. null} (Andorid) This occurs on 3.0.0. Will test it on 3.0.1 to tell if something changed. Biometric defined as -
BiometricStorage().getStorage('safe_token_repo', options: StorageFileInitOptions(authenticationValidityDurationSeconds: -1), promptInfo: const PromptInfo( androidPromptInfo: AndroidPromptInfo( title: 'Authentication', subtitle: '', description: 'Touch the fingerprint sensor', negativeButton: 'Use password', ), iosPromptInfo: IosPromptInfo( saveTitle: 'Custom save title', accessTitle: 'Enter password.', ), ));
Persists on 3.0.1, android 11. Happens after the fingerprint touch. Any Ideas?
I/BiometricPrompt(27271): onAuthenticationSucceeded: 2 I/flutter (27271): AuthService: [E] AuthException{code: AuthExceptionCode.unknown, message: Unexpected authentication error. null}
Happens after the app returns from background issue, does it help?
having the same issue! Any updates on this?
Hmm, not really but i found out that it happens when the app resumes from the background. I added a delay of a few moments before reading from the repository and it helped.
@hpoul it may be related to the app's on resume with android. Can you check what happens if the prompt is shown when the app resumes?
@itaishalom I had the same issue, after an investigation I found a possible race condition between getting the cipher and using it, I have send a PR with my fix, perhaps you want to try it as well?
Works! @hpoul can you check that PR?
@itaishalom notice @hpoul solve the issue in branch android-executor-thread, you can check it out as well
@hpoul Thank you for fixing this issue.