Biometric - For all your authentication needs 🥳

Biometric

Biometric gives you access to 5 events and 2 procedures. With Biometric, you can have the user authenticate using biometrics such as face unlock, fingerprint, password, pattern, or pin! You can’t directly specify which one(s) the system will prompt the user to authenticate with, but you can give a hint of which types to provide.

This is excluded from my open-source policy. Minimum version required is Android Lollipop 5.0 or API 21.

Permissions

USE_BIOMETRIC and USE_FINGERPRINT. These are automatically granted by the system.


AuthenticationError

Called when an unrecoverable error has been encountered and the operation is complete.

Parameter Type
code int
error string

AuthenticationError

AuthenticationFailed

Called when a biometric is valid but not recognized.

AuthenticationFailed

AuthenticationHelp

Called when a recoverable error has been encountered during authentication.

Description Parameter Type
code int
Outputs a human readable string. string string

AuthenticationHelp

AuthenticationSucceeded

Called when a biometric is recognized.

AuthenticationSucceeded

NegativeActionClicked

Called when a recoverable error has been encountered during authentication.

Parameter Type
action string

NegativeActionClicked

Authenticate

Warms up the biometric hardware, displays a system-provided dialog, and starts scanning for a biometric. This procedure has support for Android back to Lollipop (API 21).

Be aware that this was tested using Android 11 or API 30. If there are any issues with lower APIs, please report them.

API(s) Behavior Fallback Tested
28+ Will not ignore the parameters given System determines true
23...27 Will ignore the parameters given Fingerprint; Password, Pattern, or Pin if non enrolled false
21...22 Will ignore the parameters given Password, Pattern, or Pin false

Parameter Required Type
description false string
negativeActionText false, only if security strength is not Auto string
requireConfirmation can be false boolean
strength true int (Auto [n != 1 && n != 2], Strong [1], Weak [2])
subtitle false string
title true string

Description Strength
Will use device credentials such as Password, Pattern, or Pin. If the device supports fingerprint scanning, then it will use that. Auto
Will use face, fingerprint scanning, or iris scanning. Limited by hardware and relies on the system determination. Strong
Will use Password, Pattern, or Pin. Weak

Authenticate

CanAuthenticate

Determine if biometrics can be used.

Parameter Type
strength int (Auto [n != 1 && n != 2], Strong [1], Weak [2])

CanAuthenticate


io.gitlab.stormifire.biometric.aix (11.0 KB)

17 Likes

But we cannot use this extension for lower android mobile and all na.

Like oppo neo7 , Samsung a10s

2 Likes

Very Nice extension @Stormi people like you make the community heaven :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts:

1 Like

Congratulations.
Useful extension.

1 Like

You are correct, anything below Android Lollipop or API 21, you will not be able to use this for.

1 Like

I tested your extensions on an old Android 2.3.4 phone and there was an APK Parsing problem. Why do other extensions work.

The minimum API for your application will go up to API 21 when you compile, so anything below that will not install.

3 Likes