xamarin-fingerprint icon indicating copy to clipboard operation
xamarin-fingerprint copied to clipboard

Available returned & Type = Fingerprint even if no fingerprints or face registered

Open LagniappeRob opened this issue 4 years ago • 9 comments

Steps to reproduce

  1. No Fingerprints or Face registered on device, A pin has been set.

  2. CrossFingerprint.Current.IsAvailableAsync(true) returns true

  3. CrossFingerprint.Current.GetAvailabilityAsync(true) returns Available

  4. CrossFingerprint.Current.GetAuthenticationTypeAsync() returns Fingerprint

  5. Call to AuthenticateAsync returns ErrorMessage = NoFingerprint

Expected behavior

IsAvailable should be true and GetAvailability should be Available since a Pin has been set. The GetAuthenticationType should return Pin. Call to AuthenticateAsync should use Pin

Actual behavior

Fingerprint is returned by GetAuthenticationType. Call AuthenticateAsync immediately fails with error.

Crashlog

If something causes an exception paste full stack trace + Exception here

Configuration

Version of the Plugin: e.g. 1.0.0 / 1.0.1-alpha3 2.1.1

Platform: e.g. iOS 10.1 / Android 4.4 / ... (including version!!! e.g. Android 5.1 / i0S 10) Android 9

Device: e.g. HTC Sensation /i Phone 7 ... Samsung A50

LagniappeRob avatar May 12 '20 22:05 LagniappeRob

Hi @LagniappeRob,

I'm the friendly issue checker. Thanks for using the issue template :star2: I appreciate it very much. I'm sure, the maintainers of this repository will answer, soon.

smsissuechecker avatar May 12 '20 22:05 smsissuechecker

I have the same issue on Android 10, any news on this issue ?

vladPanasiuk avatar Jul 09 '20 18:07 vladPanasiuk

@LagniappeRob @vladPanasiuk That's how it works. If you allow alternative authentication by passing true, you ofc. get available back.

https://github.com/smstuebe/xamarin-fingerprint/blob/master/src/Plugin.Fingerprint/Abstractions/IFingerprint.cs#L23

if you don't want to allow alternative authentication (pin, pattern, ...), don't pass true. And if you want to allow alternative authentication you have to call AuthenticateAsync also with allowalternativeauthentication set to true.

smstuebe avatar Jul 09 '20 22:07 smstuebe

@LagniappeRob @vladPanasiuk That's how it works. If you allow alternative authentication by passing true, you ofc. get available back.

https://github.com/smstuebe/xamarin-fingerprint/blob/master/src/Plugin.Fingerprint/Abstractions/IFingerprint.cs#L23

if you don't want to allow alternative authentication (pin, pattern, ...), don't pass true. And if you want to allow alternative authentication you have to call AuthenticateAsync also with allowalternativeauthentication set to true.

I understand that. I do not allow alternative authentication. But the CrossFingerprint.Current.IsAvailableAsync (false) returns true while the phone does not support any type of biometric authentication. And the CrossFingerprint.Current.GetAuthenticationTypeAsync() returns Fingerprint. This is on a Samsung Galaxy A10, Android 10

vladPanasiuk avatar Jul 10 '20 07:07 vladPanasiuk

I have the same issue on a Samsung T510 tablet running Android 10 where the IsAvailableAsync(true) returns true, but the actual authentication with AuthenticateAsync(conf) with AllowAlternativeAuthentication set to true returns false and an ErrorMessage = "Biometric hardware unavailable". So now I test for this error message, which is a workaround but not so pretty.

klogeaage avatar Apr 11 '21 08:04 klogeaage

@klogeaage but you can't know beforehand if the user is enrolled, right?

rodrigojuarez avatar Apr 16 '21 16:04 rodrigojuarez

@rodrigojuarez not sure what you mean by 'enrolled'?

klogeaage avatar Apr 18 '21 21:04 klogeaage

Is the term used on iOS to indicate that the user has opted in from the operating system's settings to use biometrics

rodrigojuarez avatar Apr 18 '21 23:04 rodrigojuarez

My comments specifically mentioned an Android device, which is configured to require a pin whenever you unlock the screen. Apart from that, it doesn't support any biometric devices, which is also reflected in the error message you get when attempting to do an AuthenticateAsync() call. It is therefore inconsistent that the call to IsAvailableAsync(true) returns true, which I believe this issue is about.

klogeaage avatar Apr 20 '21 10:04 klogeaage