首页 > 解决方案 > Getting a unique id after biometrics authentication in flutter

问题描述

In flutter, the local_auth plugin provides a way to authenticate users using biometrics. But it only returns a Future<bool> response:

var localAuth = LocalAuthentication();
bool didAuthenticate =
    await localAuth.authenticateWithBiometrics(
        localizedReason: 'Please authenticate to show account balance');

I wonder if there is any way to retrieve some unique ID to know which user has logged into the system.

EDIT: In android, after authentication it returns a BiometricPrompt.AuthenticationResult object which contain a MAC id. I am looking for something like that in flutter.

标签: authenticationflutterbiometrics

解决方案


我不知道您如何通过生物识别实现独特性。但这里的插件是基于设备的唯一 id 提供程序。

https://pub.dartlang.org/packages/unique_id

看一看

非常轻量级的插件,获取唯一id的单行代码


推荐阅读