Unlock Face Using Confirm Credentials api

I am using api credential verification in my application to authenticate the user using the createConfirmDeviceCredentialIntent api.

Api works fine when I set my device lock as pin / pattern / password or fingerprint. But it does not work if the face is unlocked. I installed face unlock on my device and it works great when opening the device. But when I run the intent using the above api, it does not recognize face unlock, but all other things.

Is this a limitation of this api? or should I do something extra to achieve this?

It is impossible to find it anywhere, so post it here.

+12
source share
2 answers

Unfortunately, this is not possible because face unlocking is part of the Smart Lock unlock toolkit.

Other unlock methods that fall under the Smart Lock category include:

  • Body detection
  • Reliable places
  • Trusted Devices
  • Trustee (method in question)
  • Trusted voice

Since none of these methods is a primitive means of protection in Android, it makes no sense to allow access to them using the API.

If Smart Lock could be used with Keyguard, body detection could theoretically provide access to the application while in a safe place (but not in the hands of a trusted person), and even a reliable voice could be used.

Apple and Face ID can resolve this because Face ID is a primitive security method for iPhone X, because the data used to unlock the device is stored in Secure Enclave, just like Touch ID data.

I hope this gives you a good reason why this is not possible and why it makes sense that it is impossible.

Sources: Keyguard (indicating the unlocking methods that can be used), Smart Lock , Face ID

+18
source

BiometricPrompt is introduced in API 28 . It will support authentication by fingerprint, iris and face.

Here is an example of how a developer can use it in his application

enter image description here

java.lang.Object ↳ android.hardware.biometrics.BiometricPrompt 

enter image description here

Using the BiometricPrompt constructor, we can:

setTitle () - set the title to display (required)

setSubtitle () - set the display of subtitles (optional)

setDescription () - Set the description to display (Optional)

setNegativeButton () - set the text for the negative button (required).

You must also provide an instance of Executor and a click listener for the negative button.

Note. You cannot customize the icon or error message that is used in the dialog box.

 implementation 'androidx.biometric:biometric:1.0.0-beta01' 

Latest issue

GitHub source code is available here. NativeBiometricScanner developed in Kotlin

+5
source

Source: https://habr.com/ru/post/1275174/


All Articles