Biometric Authentication in Android

Sumudu Sahan Weerasuriya
2 min readFeb 25, 2020

Are you trying to create an Android Application which includes bio-metric authentications? If yes, this article will help you.

In this article, I will explain you how to implement biometric authentications with Biometric Authentication library. Biometric Authentication is an Open-Source Android Library which is developed by my self and that library supports for Java and Kotlin based android projects for biometric implementations such as fingerprint authentications, faceID, Iris etc…

Repository — https://github.com/Sumudu-Sahan/BiometricAuthentication

Implementation with Biometric Authentication library

  1. Create and Android Application
  2. Add the JitPack repository to your project level build.gradle file
Library Dependency in project level gradle file

3. Add the dependency to your app level build.gradle file

Library Dependency in app level gradle file

This library packs with SDP, SSP libraries, androidx bio-metric library, vibrator, bio-metric related permissions. Therefore no need to add below mentioned permissions again and libraries.

Below permissions are already included inside the library

Below dependencies are already included inside the library

4. Sync the project

Start Authentication

This library supports Face ID, Fingerprint, Iris scanner with BiometricPrompt and for older versions than Android Pie, supports with custom fingerprint authentications.

When the application start the biometric authentication, for older android versions (Below Android Pie) will prompt a dialog with authenticator.

Fingerprint Authentication in older android versions (Below Android Pie)

For new android OS versions (Android Pie or above), app will prompt the biometricprompt dialog to authenticate.

Fingerprint Authentication in newer android versions (Android Pie or above versions)

Authentication Failing Reasons

Below are the reasons when the biometric authentication has failed.

For more information, Please refer the wiki in repository.

That’s it!!!

Congratulations on setting up your Android application with Biometric Authentication Library and I hope you found the article helpful with getting you ready to use the Biometric Authentication Library. Happy coding!

--

--

Sumudu Sahan Weerasuriya

Senior Software Engineer @ WSO2 | 2nd Runner-Up of WSO2 Certified Employee of the Year — 2021 | 10X WSO2 Certified | BIT(UCSC) | DiHN | OCPJP