Face Id authentication in android (Ionic)
Asked Answered
S

2

6

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.

Specialism answered 15/5, 2018 at 9:13 Comment(0)
G
7

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:

Geodesy answered 30/5, 2018 at 11:24 Comment(0)
C
1

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!

Circumbendibus answered 21/1, 2019 at 13:3 Comment(1)
I also want to add, that I have decided not to use faceID on Android for now, since it is not considered as "safe" as iOS ref: https://mcmap.net/q/947432/-face-recognition-authentication-in-android-closedCircumbendibus

© 2022 - 2024 — McMap. All rights reserved.