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

unexpected userAuthRequired behaviour #43

Closed jskrepnek closed 7 years ago

jskrepnek commented 7 years ago

Hi,

Using plugin version 1.2.2. Android version 7.1.1 (Nexus 5X)

When I set 'userAuthRequired' to false, the PIN is still being required on the first use of the key. I was expected that not to be the case.

Here's a snippet of the call to encrypt:

$window.FingerprintAuth.encrypt({
    clientId: ENV.appId,
    dialogMessage: 'Message',
    userAuthRequired: false,
    disableBackup: true
},

Since backup is disabled, the call to encrypt fails.

@mjwheatley, I'm I understanding the intention of 'userAuthRequired' correctly? If so, any idea what's happening?

Thanks for your work on this!

mjwheatley commented 7 years ago

The userAuthRequired param defaults to true. I'm guessing that you've opened the dialog prior setting the userAuthRequired param to false. So this would be expected behavior if it wasn't set to false from the get go. If userAuthRequired was not set the first time the dialog was opened, then you set it to false, you will need to use the backup to reset the plugin one time. Then you should be good.

This is usually only an issue during development. Once you have the configuration set, first time users of your application should not run into this problem.

jskrepnek commented 7 years ago

Thanks, that was the issue - after reinstalling the app, it works as expected.