Play Store 512

Cordova Biometric Auth plugin demo

Demo app for testing the cordova-plugin-biometric-auth, which allows to authenticate users with biometrics or fallback PIN, pattern or password. Uses AndroidX and supports Android 5.0 onwards. Source code available in GitHub.

Apache Cordova logo phonegap

Android screenshots

Browser screenshots

Methods

This is a summary of the demo app’s methods. Refer to plugin’s README for details

isAvailable

Checks if the user can authenticate with either biometrics, fallback PIN, pattern or password. Biometric requires at least one biometric sensor to be present, enrolled, and available on the device.

Android quirks

Not all combinations of authenticator types are supported prior to Android 11 (API 30). Specifically, DEVICE_CREDENTIAL alone is unsupported prior to API 30, and BIOMETRIC_STRONG | DEVICE_CREDENTIAL is unsupported on API 28-29.

Browser quirks

This filler platform always returns BIOMETRIC_SUCCESS and does not check nor use a real biometric device.

authenticate

Shows the biometric prompt or the fallback device credential dialog for authentication.

Android quirks

Not all combinations of authenticator types are supported prior to Android 11 (API 30). Specifically, DEVICE_CREDENTIAL alone is unsupported prior to API 30, and BIOMETRIC_STRONG | DEVICE_CREDENTIAL is unsupported on API 28-29.

Browser quirks

Browser platforms shows a dialog to manually select either of these results and does not perform any actual biometric check:

  • AUTHENTICATION_FAILED
  • BIOMETRIC_DISMISSED
  • BIOMETRIC_SUCCESS

Remarks

Both isAvailable and authenticate methods will use the selected authenticators value from the drop-down list with one of these options:

The option AUTO (0) can be used to check for biometrics + device credentials as fallback with a single and reliable method. Recommended to check if you can use the PIN, pattern or password authentication when no biometrics are enrolled or supported. Android 5 supported.

The authenticator KEYGUARD_MANAGER (1) is a plugin-created value to directly check if you can use PIN, pattern, password or biometrics if enrolled. Can be used starting Android 5.

Whenever you use the KeyguardManager authenticator on Android 6 to 9 inclusive, the fallback PIN, pattern or password with optional biometrics screen will be shown as follows:

Download demo app

Feedback

Use the comments section here for demo app-related issues, and the GitHub issues tracker for plugin-related ones.

More plugin demo apps

Check out the following Cordova plugin demo apps ready for download on your device. The source code is included for compiling to any platform.

Disclaimer

The content in this post is for general information purposes only. The information is provided by the author and/or external sources and while we endeavour to keep the information up to date and correct, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability or availability with respect to the website or the information, products, services, or related graphics contained on the post for any purpose. Some of the content and images used in this post may be copyrighted by their respective owners. The use of such materials is intended to be for educational and informational purposes only, and is not intended to infringe on the copyrights of any individuals or entities. If you believe that any content or images used here violate your copyright, please contact us and we will take appropriate measures to remove or attribute the material in question.