简体   繁体   中英

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:

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 OK in 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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM