flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
166.32k stars 27.53k forks source link

[local_auth] Allow authentication for devices without biometrics #49703

Closed kennethj closed 3 years ago

kennethj commented 4 years ago

Allow local authentication for devices without biometrics.

Ideally, a method (LocalAuthentication().authenticate()) that would defer to the OS to determine the proper authentication type.

iOS: https://developer.apple.com/documentation/localauthentication/lapolicy/lapolicydeviceownerauthentication?language=objc

Android: https://developer.android.com/training/sign-in/biometric-auth#biometric-or-lock-screen

vanlooverenkoen commented 4 years ago

@VladyslavBondarenko is it possible to already review the pr? This is something we need in our current application

VladyslavBondarenko commented 4 years ago

@vanlooverenkoen you can ask assigned for the review person in the pr conversation

vanlooverenkoen commented 4 years ago

@VladyslavBondarenko there is nobody assigned yet.

VladyslavBondarenko commented 4 years ago

@vanlooverenkoen sorry, ambiguously said, I meant @mehmetf in reviewers

kennethj commented 4 years ago

@vanlooverenkoen You could use this fork. It was created as a stopgap until this could be reviewed and merged. https://pub.dev/packages/local_auth_device_credentials

REKURDennis commented 3 years ago

Sadly on iOS the passcode as fallback is not shown for FaceID users. This is because the plugin sets context.localizedFallbackTitle = @""; hardcoded and is not configurable. The title should be configurable to show a customised title or disable it.

https://developer.apple.com/documentation/localauthentication/lacontext/1514183-localizedfallbacktitle?language=objc

REKURDennis commented 3 years ago

There is another problem: next to getAvailableBiometrics there should be a second method getAvailableAuthenticationMethods or similar. Because it should be possible to check if the user either enrolled any biometric method, or a code/pattern/what_so_ever. "isDeviceSupported" returns true even if the user hasn't enabled any authentication. If he then turns on authentication for my app he is locked out and has to know that he should set at least a device passcode to get in again.

stuartmorgan commented 3 years ago

Looks like this didn't get closed as fixed when the PR landed; closing.

@REKURDennis Please file new issues for follow-ups.

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.