I am using Fingerprint AIO to secure my mobile app, but I am a bit confused about what to do here. As far as I can tell, this library only expose 2 functions isAvailable()
and show()
. So I give it a try on my project:
import { FingerprintAIO, FingerprintOptions } from '@ionic-native/fingerprint-aio/ngx';
initFingerprint() {
const opt: FingerprintOptions = {
title: 'Fingerprint - FaceID authentication',
subtitle: "It's quick and easy",
description: '',
fallbackButtonTitle: 'Use Pin',
cancelButtonTitle: 'Cancel',
disableBackup: false
}
this.faio.show(opt)
.then((result) => {
console.log(result)
// What should I do here ???
})
.catch((error) => {
console.log(error);
})
}
The function above works fine, but what should I do in the then()
callback? How can I tell my server that this user already authenticated successfully with their finger (or face)?
My assumption is that I need to encrypt their username and password in a text file then decrypt it later if they successfully authenticated and send that information to my server. But this seems like a lot of thing to do.
P/s: Here the library: https://github.com/NiklasMerz/cordova-plugin-fingerprint-aio