CoDe
CoDe

Reputation: 11156

BiometricPrompt iris and face prompt is not working with Crypto object authentication. #AndroidX

Issue

Source reference:

Device used for testing:

Steps of Authentication I'm following:

and there is another authentication method which take cipher object to make sure

Everything worked just as expected with new and older API device support. Until unless realize tested application for other biometric authentication option iris and using face detection.

If I follow

Question

enter image description here

Upvotes: 10

Views: 5754

Answers (2)

takharsh
takharsh

Reputation: 2688

Face-Id is considered as WEAK authenticator. If you set .setAllowedAuthenticators(BIOMETRIC_WEAK or DEVICE_CREDENTIAL) in BiometricPrompt Info and performs any Key based crypto operations. It will throw

java.lang.IllegalArgumentException: Crypto-based authentication is not supported for Class 2 (Weak) biometrics.

For crypto-based authentication only allowed authenticators are BIOMETRIC_STRONG or DEVICE_CREDENTIAL

Refer table here: https://source.android.com/docs/security/features/biometric

Upvotes: 1

Isai Damier
Isai Damier

Reputation: 984

Some devices only have one form factor, some have many form factors. Which form factor your app ends up using isn't really up to you; it's up to the OEM implementation. As explained in this blog post, whether a form factor is Strong or Weak doesn't depend on your code -- the OEM decides. However, you can request that a device uses Strong authentication for your app by specifying a CryptoObject when you call authenticate().

What you are experiencing is that the OEMs of your devices decided to make Fingerprint the default for Strong biometrics. Therefore, when you pass in a CryptoObject to authenticate() those devices show the user the UI for Fingerprint.

Upvotes: 2

Related Questions