Use default face Unlock functionality in own Android app - android

I want to enable fingerprint and face unlock for my application. I have fingerprint unlock code and it is working fine if the user is already registered his fingerprint.
I want to enable the same feature for face unlock as well. If the user has already enrolled his face id, then he should be able to authenticate the app with face unlock. I don't want to create any library here, I just want to invoke the device face unlock app and authenticate.

Starting with Android P, you can use the BiometricPrompt API - it will automatically support whichever biometric authentication mechanism is physically present on the user's phone.
See this blog post for a brief overview of the feature, and the docs for how to implement this. This blog post contains a walk-through of all the steps to implement this.

Related

Face Id authentication in android (Ionic)

I am developing a Hybrid application for which once the user enters the username and password initially after successful login the user is prompted with a dialog box asking whether to enable FaceID unlocking or not. If the User presses Yes next time the user will directly will be asked to scan the face instead of username and password. In iOS i am successful in doing this.
But how to implement the same in the Android using Cordova. Is there any specific plugin to enable it. If it is there please help me with the plugin or If not please specify the reason.
It is not possible to achieve the same capabilities of the Face Id to unlock an app on Android, so it wouldn't be possible even using Android native app.
Android uses the keymanager to achieve unlocking capabilities on apps, using primitive authentication methods. That allows you to use pin code or fingerprint authentication. At this time, face recognition is not available yet.
Apple and Face ID can allow this because Face ID is a primitive security method for the iPhone X, as the data used to unlock the device is kept in the Secure Enclave, in the same way that Touch ID data is.
My guess is that Android will follow Apple's steps and implement a solution like Face ID for authentication in one of Android's next versions (not on Android P), but until then, if you really must have face recognition to unlock your app, you can try using 3rd-party libraries, but none will fully achieve the Face Id native capabilitues
Sources:
Related stackoverflow article
Android Keyguard docs
Third party image recognition cordova plugin
Face ID on Android adoption
I am using the plugin called cordova-plugin-keychain-touch-id and it works both for face and touch.
Be aware that some Android phone both have face and touch, and if both are enabled, it returns OKin stead of touch or face.
Also with Android's OREO OS made it possible for older Android phone to login with face biometrics using something called "Trusted Face".
I am still having some issues with face login activation on the phones where both are enabled and with the trusted face, but maybe you (or someone else) have a solution for this :)
Good luck!

face unlock using Confirm Credentials api

I am using confirm credentials api in my app to authenticate user, using createConfirmDeviceCredentialIntent api.
The api is working fine when I have set up my device lock as pin/pattern/password or fingerprint. But, it's not working in the case of face unlock. I've set face unlock in my device and it's working fine when opening the device. But when I launch the intent using the above mentioned api, it's not recognizing face unlock but all the other things.
Is this a limitation of this api? or I've to do something extra to achieve this?
Can't find this anywhere so posting here.
Unfortunately, this isn't possible because unlocking using your face is part of the Smart Lock set of unlock tools.
Other methods of unlocking that fall under the Smart Lock category include:
On-body detection
Trusted places
Trusted devices
Trusted face (the method in question)
Trusted voice
Because none of these are primitive security methods in Android, it does not make sense to allow these to be accessed using APIs.
If Smart Lock could be used with Keyguard, on-body detection would be in theory be able to grant access to an app, being in a trusted place (but not in the hands of a trusted person) and even trusted voice could be used.
Apple and Face ID can allow this because Face ID is a primitive security method for the iPhone X, as the data used to unlock the device is kept in the Secure Enclave, in the same way that Touch ID data is.
I hope this gives you enough reason as to why this isn't possible, and why it makes sense that this isn't possible.
Sources:
Keyguard (stating unlock methods allowed to be used), Smart Lock, Face ID
BiometricPrompt is introduced in API 28. It will support fingerprint, Iris and face authentication.
Here's an example of how a developer might use it in their app
java.lang.Object
↳ android.hardware.biometrics.BiometricPrompt
Using the BiometricPrompt builder we can:
setTitle() — Set the title to display (Required)
setSubtitle() — Set the subtitle to display (Optional)
setDescription() — Set the description to display(Optional)
setNegativeButton() — Set the text for the negative button(Required).
You must also provide an Executor instance and a click listener for the negative button.
Note: You can’t customise the icon or error message that are used within the dialog.
implementation 'androidx.biometric:biometric:1.0.0-beta01'
Latest Release
GitHub source code available here NativeBiometricScanner developed in Kotlin

Fingerprint authetication of multiple users

I am a beginner in android development.I want to create an application having Finger authentication.I want to register multiple users(50) finger prints using finger sensor of phone.Also i want to authenticate it when user logins.Can anyone help us?
FingeprintManager only has these 3 features:
authenticate : for authenticating user
hasEnrolledFingerprints : Determine if there is at least one fingerprint enrolled.
isHardwareDetected : Determine if fingerprint hardware is present and functional.
you can check FingerPrintManager docs here :
https://developer.android.com/reference/android/hardware/fingerprint/FingerprintManager.html
As per Nexus FAQs
Your fingerprint data is stored securely and never leaves your Pixel
or Nexus phone. Your fingerprint data isn't shared with Google or any
apps on your device. Apps are notified only whether your fingerprint
was verified.
which explains very well that you can use fingerprints for verification purpose only. Its just an alternative to any app lock available in marketplace.

Android fingerprint

I am a newbie in android development
I am developing an android app that allow people using fingerprint to check-in. The idea is, for instance, a class need student check-in on time everyday. Student have to register their fingertip to identify with application.
I don't know whether android support my application? I just saw that fingerprint identify using registered user's finger.
Could you please help me some idea?
Thank you so much.
Android supports detecting more than one fingerprint.
Eg:Coolpad note 3 detects 5 different fingerprints and we can assign different actions to each fingerprint.
i.e one for unlock screen,one for camera.
Detecting and authentication of different fingerprint is based on how you code your application.So go forward.
You can find here the code for the implentation of Fingerprint authentication in an app
remember one thing that,here you can login in your app only using the fingerprint that you have used for the device's screen lock.
Android authorizes or verifies a user if the fingerprint was previously registered through Android settings. Meaning, you can't add new fingerprints through your app.
The KeyStore save all the keys and use the Keystore private key to sign transactions / data. Meaning, you cannot differentiate users through your app.

Using Android's Fingerprint Scanner for Application

I need to create an application that scans fingerprints and authenticates them. I can't find anything about fingerprint permissions on the Android website.
Is it possible to use a phone's fingerprint scanner for a regular application? If so, what is the limit on the number of fingerprints it can store (I'd prefer to store them on the phone itself)
Thanks
Fingerprint scanner is not a feature in Android (Now available on Android M).
So each company as Samsung, Motorola, HTC create is own API and SDK to access to fingerprint sensor.
For instance Samsung provide a SDK http://developer.samsung.com/galaxy#pass
Pass SDK allows you to use fingerprint recognition features in your
application. With Pass SDK, you can provide reinforced security, since
you can identify whether the current user actually is the authentic
owner of the device.
If you want to enroll multiple users and check users in your app, it's not possible with Samsung device. You could only check owner of device.
I don't know SDK of other companies.
UPDATE
Android M have new FingerPrint API:
https://developer.android.com/about/versions/marshmallow/android-6.0.html#fingerprint-authentication
Android M preview introducing FingerPrint scanner API.
You can checkout example for this here :
https://github.com/googlesamples/android-FingerprintDialog/
I needed a similar functionality and my solution was to use an external scanner instead of use a device with integrated fingerprint scanner. There are several companies which offer integration with mobile phones through SDKs. You should research through out the next companies on google:
Nitgen: http://www.nitgen.com/eng/product/Hamster3.html#a2
Secugen: http://www.secugen.com/products/sdk_pro.htm#android
Tactivo: http://precisebiometrics.com/smart-card-reader/android/
In my case I used Secugen, but feel free to use the suitable device for your solution. Notice that this solution could make your project cheaper because you don't need to use an expensive mobile phone, the only feature that the phone needs it's having a USB OTG (On-The-Go).
I know this solution it's a bit different from what your were asking for but I believe that it could be interesting for you too.
You can opt to use an external Fingerprint Scanner and be able to Enrol Biometric Fingerprints from Persons you are Registering then proceed to save the Biometric Fingerprint Data and Person's particulars in your Android Phone. In my case I used a DigitalPersona type 4500 Fingerprint Scanner and used the Crossmatch API for Fingerprint Capture.
This is actually the easiest and feasible way for you if you want to succeed at Capturing Biometric Fingerprint Data and Save it in your Android Phone from more than one Individual. In fact what can limit you from enrolling more Biometric Data from various Enrollees will be the memory size constraints of your Android Mobile Phone / Device. This you can however easily circumvent by integrating your Android Biometric Authentication App with an external RDBMs Centralized Database of your Organisation like an MSSQL, Oracle, MySQL, PostgreSQL etc.
If it pleases you, you can choose to use the Source AFIS API to implement it with much ease. For motivation you can check out this project's web page here at [Android Biometric Authentication using External USB Fingerprint Scanner][2] that I developed [here][2].
See screenshots I have attached below for Fingerprint Authentication when the result is a MATCH FOUND and when the result is MATCH NOT FOUND. I have also included a screenshot for when FINGERPRINT ENROLLED.
I designed the User Interface ( GUI) that is reusable on Android Mobile Phone screens of various screen sizes for both Fingerprint Enrollment and Fingerprint Authentication. You can design your own interface anyway but in my case I wanted to be able to display the Person's Fingerprint during Authentication and I added an Activity for swapping Fingerprint Images on display after Finger Touch event is fired if Person places Finger on Fingerprint Scanner.
Happy coding.
[2]: https://jomutech.com/androidexternalfingerprintscanner/
Simple answer is NO.
But you can integrate it by Implementing Google's fingerprint recognition introduced in Android M which only supports 5 attempts at a time, if all the attempt fails your device finger print reader will be blocked for 30 seconds, then after that duration you can authenticate with the fingerprint again.
For example you are using an 2 app(A & B) with finger print support. Then you enter 3 incorrect fingerprints and then you close the app A, then you open the app B so there are total 5 attempts available within 30 seconds so your app can only authenticate 2 times because app A took 3 attempts hence after 2 unauthorized attempts the OS blocks the reader for all apps.
So wait for 30 seconds or ask the user to enter pin or passcode accordingly if the user doesn't wants to wait for that amount of time.
Hope this helps.

Categories

Resources