smstuebe / xamarin-fingerprint

Xamarin and MvvMCross plugin for authenticate a user via fingerprint sensor
Microsoft Public License
490 stars 115 forks source link

UWP GetAvailabilityAsync returns "Available" on laptop without sensor #80

Closed ruisilva450 closed 6 years ago

ruisilva450 commented 6 years ago

Hi, I wanted to try this plugin in a forms application that targets UWP. I'm checking the availability of the fingerprint sensor first before navigation for a screen to configure that association in my app. But on my Windows laptop that doesn't have the sensor, the plugin still says that it's available.

Steps to reproduce

  1. Have a laptop, running in the app em debug, that doesn't have fingerprint sensor (but I have PIN configured for login)

  2. At some point I'm asking the plugin for the availability of the sensor await CrossFingerprint.Current.GetAvailabilityAsync(false)

  3. This returns as result the enum "Available"

Expected behavior

Return the enum "NoSensor"

Actual behavior

Return the enum "Available"

Crashlog

Doesn't crash.

Configuration

Version of the Plugin: 1.4.5.0

Platform: Windows 10 version 1703 (15063.674)

Device: e.g. Toshiba Satellite Pro A30-C (U3E1)

smsissuechecker commented 6 years ago

Hi @ruisilva450,

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.

smstuebe commented 6 years ago

As far as I know, UWP doesn't offer an API to specify the way of authentication :/

see: https://docs.microsoft.com/en-us/uwp/api/Windows.Security.Credentials.UI.UserConsentVerifier#Windows_Security_Credentials_UI_UserConsentVerifier_CheckAvailabilityAsync

Do you know one?

ruisilva450 commented 6 years ago

Since you are checking for the availability maybe you can use the Enum from the result:

and return the equivalent from your Enum.

see: https://docs.microsoft.com/en-us/uwp/api/windows.security.credentials.ui.userconsentverifieravailability and https://docs.microsoft.com/en-us/windows/uwp/security/fingerprint-biometrics

smstuebe commented 6 years ago

This is what the plugin does. The problem is, that it just looks if any authentication is available. And you can't say "please check for fingerprint sensor".

https://github.com/smstuebe/xamarin-fingerprint/blob/0a2f2699c44cde97cd43080a0264477e404df347/src/Plugin.Fingerprint.UWP/FingerprintImplementation.cs#L52-L70

ruisilva450 commented 6 years ago

Ok then. Your job here appears to be well done. Microsoft needs to do their part. Thanks