mjwheatley / cordova-plugin-android-fingerprint-auth

A cordova plugin for fingerprint authentication using the hardware fingerprint scanner on devices running Android 6+
Apache License 2.0
168 stars 131 forks source link

When does the attempt count reset to zero again? #77

Closed RYFN closed 7 years ago

RYFN commented 7 years ago

setting maxAttempts=2 initially gives us three attempts before the "too many attempts, try again later" dialogue shows.

If we force close the app, open it swiftly afterwards, show the auth dialogue again, we get 2 attempts. Doing the same thing, but leaving the app closed for a few minutes gives us 3 attempts again.

How long does it take for the attempt count to drop back to zero? (is this handled by the hardware manufacturer?)

mjwheatley commented 7 years ago

I found that the device default is 5 attempts. The plugin initializes the attempt count to zero every time it is launched. However the OS has it's own counter.

All I have done is dismiss the dialog if the max attempt param has been exceeded and it would be up to the developer to handle their own time out.

I suppose the OS has a cool down time before resetting the attempt count but I do not know what that is or if it varies by manufacturer or not. So if initially limit the dialog to 3 attempts, the hardware will still only allow 2 more attempts. If you limit the dialog to 4 attempts and try again you will only get 1 more attempt.

To reiterate, this was a feature request for developers that wanted to moderate / enforce fewer attempts than the default. You will need to calculate the cool down time for your custom max attempts and only launch the dialog after that time has expired. I do not believe there is a way to reset the default OS attempts.

RYFN commented 7 years ago

Thank you for your feedback on this, it's most appreciated 👍