Android biometric verification - how to get a unique user id?

117 views Asked by At

I am looking at incorporating android.hardware.biometrics classes in my Android application. I need a way to associate a unique id for the given user based on the biometric signature. Is there anything in BiometricPrompt fields that I can use to identify the user uniquely?

Obviously, the user id cannot change on each biometric scan. Regards.

1

There are 1 answers

2
CommonsWare On

If you are planning on using OS-level user accounts (e.g., Settings > System > Multiple Users on a Pixel 6), it's possible they could each have enrolled fingerprints — I have never experimented with this. Each user would have independent internal and external storage, though, so you would create your own unique ID, such as generating a UUID and storing it in internal storage.

If, instead, you were planning on having a more traditional single-user phone setup, but still have N people register fingerprints on that phone and somehow tell them apart... Android's biometrics system does not support that. You would need to use an external fingerprint sensor and its SDK.