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

On non-fingerprint hardware is there a way to fallback to backup auth methods? #63

Closed matrixn closed 7 years ago

matrixn commented 7 years ago

Hey guys,

I'm not sure if this is an issue, but wouldn't be logic that if the plugin does not detect fingerprint hardware to fallback to backup methods (PIN, Pattern or Password) ... I've been looking for a way to do this.

Can anyone point me to the right direction?

vipin1code commented 6 years ago

Does this work?

I am testing on One Plus 5. With fingerprint added this works. But if I remove fingerprint on device and only have "Pin" screen lock security, it doesn't work.

If get following result from isAvailable() function: {hasEnrolledFingerprints: false, isAvailable: false, isHardwareDetected: true}

I am expecting a behaviour that if fingerprint isn't setup on device it automatically fallbacks to backup method.

mjwheatley commented 6 years ago

Yes, it should still work. You will get false from isAvailable() but you can still call the encrypt() method. Durning the encrypt flow the plugin checks isAvailable() and if it returns false then it launches the backup authentication.