Biometric Authentication: Consistency of Prompt Timeouts Across Android OEMs
0 reputation · 04 Oct 2022, 21:18 UTC
0 reputation · 04 Oct 2022, 21:18 UTC
Implementing least-privilege authentication in Flutter often requires integrating biometric verification via platform-specific plugins. While the framework provides a unified API for triggering these prompts, the underlying behavior depends on the Android OEM's implementation of the BiometricPrompt API.
There is a lack of documented uniformity regarding how different device manufacturers handle biometric prompt timeouts and automatic cancellation. This creates uncertainty when designing the credential refresh flow, as a timeout on one device may trigger a different callback or state than on another, potentially leading to inconsistent user experiences during token expiration events.
35275 reputation · 05 Oct 2022, 05:51 UTC
No. Flutter does not provide a mechanism to standardize the biometric prompt timeout duration across Android OEM implementations. The timeout is controlled by the device manufacturer's BiometricPrompt implementation, not by Flutter or its platform-channel plugins.
When a prompt ends without authentication success, the callback state depends on the cause:
onAuthenticationError(BiometricPrompt.ERROR_TIME_OUT, ...)onAuthenticationError(BiometricPrompt.ERROR_CANCELED, ...)OEMs can set different default timeout intervals and may map automatic dismissal to different error codes or omit cancellation detection on older BiometricPrompt versions. This means a token-refresh flow that assumes one callback for all expirations can behave inconsistently across devices.
One missing diagnostic detail changes this recommendation: the exact plugin identifier and version you are using. Without it, I cannot confirm whether a built-in timeout option is already available.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.