Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KeyGeneration using AndroidX.Biometric fails if only face as biometric is installed

we are currently trying to sign data with biometrics, which we use the androidx.biometric library for.

The Problem is, if no Fingerprint ist installed but a face registered we cannot generate any keys.

With Fingerprint only or with the combination of fingerprint and face everything works perfect.

With only the face registered we get the following exception during key generation:

Caused by: java.security.InvalidAlgorithmParameterException: java.lang.IllegalStateException: At least one biometric must be enrolled to create keys requiring user authentication for every use

Before we start the key generation we test the presence of biometric as following:

boolean isAvailable = biometricManager.canAuthenticate() == BiometricManager.BIOMETRIC_SUCCESS;

The Test-Device as a Samsung Galaxy S10 with Android 10.

Thank you for help and best regards

like image 613
Langohr Avatar asked May 09 '20 14:05

Langohr


People also ask

How do I set up biometrics on authentication app?

Turn on biometrics in the Android device settingsOpen your phone's Settings and locate the security or biometrics menu. From this menu, set your biometrics preferences to fingerprint.

How does biometric authentication work in mobile app?

The biometric authentication feature allows your mobile app (iOS, Android) users to log in to their device either using their Fingerprint or Face ID. This feature allows the end-users to quickly access their app using their fingerprint and it is considered as the most secure way of login.

How do I enable biometrics on Android Chrome?

Select Settings . Under "Accounts," select Screen lock. Enter your password and select Confirm. Next to "Edit fingerprints," select Set up.


1 Answers

Google has updated androidx biometric sdk. If you are going to use strong type authentication in your application.Authentication can be checked for the strong type. If your device is suitable for this, you can create a cryptoObject.

https://developer.android.com/jetpack/androidx/releases/biometric#1.1.0-alpha02

https://developer.android.com/reference/android/hardware/biometrics/BiometricManager#canAuthenticate(int)

val canAuthenticate = BiometricManager.from (context)
.canAuthenticate (BiometricManager.Authenticators.BIOMETRIC_STRONG)

After this check, you can proceed to key generation.

like image 69
Eniz Bilgin Avatar answered Oct 09 '22 10:10

Eniz Bilgin