Hi, I'm trying to get the authentication from our hybrid app working with fingerprint next to pincode. I found the git from the hybrid-app-base (with the fingerprintView.js) but i'm stuck on getting it to work. If I'm right the only thing I need to do is compile with node.js and apply my own settings and styling. Except now the hybrid app isn't asking for any pincode after succesfully passing the username and password. Am I missing something? Or is there any other way to get fingerprint authenitcation working on hybrid apps? Thanks!
Joris van Dinther
Whose repository are you using? The one from Conner (cdcharlebois) is probably your best bet. Then there are a few other things required:
Ensure you've got the correct settings.json with PersistentSession enabled like here
Next, in order to get the app to actually prompt for TouchID/FaceID, or a pin, you need to set a localStorage value. See the code here.
Setting mx-user-pin to true enables pin codes
Setting mx-user-finger to true enables fingerprint or faceID
I'm not 100% sure what mx-user-token is for - I'll find out for you
You can use the LocalStorage Reader/Writer widget to give users switches to enable/disable Pin and TouchID themselves. Or, just set mx-user-finger to true in localstorage (or change the code in entry.js to just pass true) and *I think* it'll it'll just start prompted for your fingerprint/face.
Thanks all for the help.
I've got it running now and just some tweaking and debugging to do with cancel actions from users so it has a fallback.
Things I had to do adjust at the code from Conner:
I was missing the plugins in my config.xml (touch-id for iOS and fingerprint-auth for Android).
Default the code was not asking the first time for making a PIN code so I adjusted the app.js so it will look at pinRequired and to localStorage because this one is not used yet.
If a user sets a PIN code I fill the localStorage ("mx-user-pin", true) and localStorage("mx-user-finger", true).
Thanks all for the help!
Joris van Dinther
To use mobile device functionality (and I am assuming that getting a fingerprint is device functionality), you should create a Mendix widget which utilizes Cordova functions to access this functionality.
Then, you should override the Mendix login functionality to accept output of the fingerprint scanner and verify that output and the PIN.
Rom van Arendonk
you could try to integrate a third party api solution with youre app. take a look at onegini for example