Kes*_*ari 6 flutter localauthentication
我已经浏览了local_auth包,它工作正常,但没有选项可以使用密码或引脚进行身份验证.帮助赞赏!
String _authorized = 'Not Authorized';//Start
Future<Null> _authenticate() async {
final LocalAuthentication auth = new LocalAuthentication();
bool authenticated = false;
try {
authenticated = await auth.authenticateWithBiometrics(
localizedReason: 'Scan your fingerprint to authenticate',
useErrorDialogs: true,
stickyAuth: false);
authenticated = await auth.authenticateWithBiometrics(localizedReason: 'Authenticate');
} on PlatformException catch (e) {
print(e);
}
if (!mounted) return;
setState(() {
_authorized = authenticated ? 'Authorized' : 'Not Authorized';
});
}//End
Run Code Online (Sandbox Code Playgroud)
所以这是示例代码,您可以使用生物识别身份验证,但是指纹中还存在默认的Pin/Password身份验证.
出于安全原因,移动设备(iOS/Android)将仅通过生物识别来验证用户,而不是系统密码/密码。如果您想让用户通过生物识别以外的其他方法进行身份验证,则应用程序本身必须存储和处理(加密)凭据,该凭据与系统密码/pin完全分离。
您可以在许多银行/金融相关应用程序中看到这种行为(使用系统生物识别和应用程序特定凭据),例如https://play.google.com/store/apps/details?id=com.konylabs.capitalone&hl =zh
| 归档时间: |
|
| 查看次数: |
412 次 |
| 最近记录: |