Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.0.1-dev.1 returns CanAuthenticate.sucess if device has no credentials set #104

Closed
SylvainLosey opened this issue Oct 18, 2023 · 4 comments · Fixed by #115
Closed

5.0.1-dev.1 returns CanAuthenticate.sucess if device has no credentials set #104

SylvainLosey opened this issue Oct 18, 2023 · 4 comments · Fixed by #115

Comments

@SylvainLosey
Copy link

Hello,

I might be misunderstanding something, but it seems that the latest dev version has an oversight where canAuthenticate would return successfully whenever the device has no credentials enrolled. This does not seem like the expected behavior, am I missing something ?

        val credentialsResponse = biometricManager.canAuthenticate(DEVICE_CREDENTIAL);
        logger.debug { "canAuthenticate for DEVICE_CREDENTIAL: $credentialsResponse" }
        if (credentialsResponse == BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED) {
            return CanAuthenticateResponse.Success
        }

Thanks a lot for the great package,
Sylvain

@OlliePorter
Copy link

Seconded! We're using 5.0.0+1 and calling the canAuthenticate function as so, but we're getting back a success when it should be a failure.

 Future<bool> isDeviceEligible() =>
      storage.canAuthenticate().then((value) => value == CanAuthenticateResponse.success);

The emulator we're using is an iPhone 15 Pro with Face ID capabilities, but these have not been set up. The device is not enrolled, so we're expecting canAuthenticate to return errorNoBiometricEnrolled.

@10ndavis
Copy link

10ndavis commented Jan 17, 2024

@hpoul is this plugin still being maintained? This issue seems critical, as it defeats the purpose of the plugin entirely if biometrics do not prompt but we allow access to the storage.

@SylvainLosey
Copy link
Author

Agreed. For information I fixed the issue for our internal use, I will try to find the time to clean it up and raise a PR but it would be good to know if someone is still available to get it reviewed and merged.

@flumm
Copy link

flumm commented Apr 16, 2024

Agreed. For information I fixed the issue for our internal use, I will try to find the time to clean it up and raise a PR but it would be good to know if someone is still available to get it reviewed and merged.

i recently opened another issue, but i believe it's the same (or at least similar) issue: #114

what exactly did you do to fix the issue for you?

ThomasLamprecht added a commit to ThomasLamprecht/flutter_biometric_storage that referenced this issue Apr 16, 2024
Returning success if we get an error from the underlying HW that no
key is enrolled does not make sense, rather return the enum value
designed for this case.

Closes: authpass#104
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants