eddyverbruggen / cordova-plugin-touch-id Goto Github PK
View Code? Open in Web Editor NEW:nail_care: 👱♂️ Forget passwords, use a fingerprint scanner!
License: MIT License
:nail_care: 👱♂️ Forget passwords, use a fingerprint scanner!
License: MIT License
It's a new iOS 9 property for the LocalAuthentication.framework.
Actually when adding a new fingerprint this plugin will just work with the new fingerprint, but what if the device code is hijacked and a new fingerprint added by the hijacker. He can then just unlock any app that uses this plugin with that new fingerprint.
See this for more details: https://godpraksis.no/2016/03/fingerprint-trojan/
And this for an example implementation: https://github.com/dannycabrera/DotNetMiami/blob/master/ViewController.cs
Hello,
I'm using your plugin and it works really great.
But I want to prevent the user from entering his passcode if fingerprint scanning failed.
How can I do this ?
While using verifyFingerPrint method, is there any way to identify whether user has used actual fingerprint to authenticate or passcode. Right if we use passcode or fingerprint we are getting null as response. So we are not able to differentiate fingerprint authentication and passcode authentication.
Thanks for the plugin! I haven't been able to compile my application I am getting the following
Errors:
Warning:
Can you help Please!
by using this method "window.plugins.touchid.verifyFingerprintWithCustomPasswordFallback" , i am not getting the default enter passcode page after clicking on "Enter Password" button (i am not getting any default screen), whereas by using the method "window.plugins.touchid.verifyFingerprint" i will get the default passcode page, can you please suggest why this is happening.
Each time a user initiates authentication with a valid fingerprint, Touch ID retrieves the private key from the keystore, creates a token, signs it with the private key and sends it to Auth0. Auth0 then returns an id_token, the user profile and, optionally, a refresh_token.
Any method to retrieve the tokens and profile?
thanks for the plugin Eddy!
Also Please guide me that how we can test it in xcode simulator.
Correct me if I'm wrong, but it looks like this library only gives a yes/no on whether the fingerprint matched. It does not allow me to securely protect data using the fingerprint. (As can be done with the underlying native library.)
Looking at the .m file, it looks like you're storing dummy data, and not exposing it.
I would like to use the user's fingerprint to secure credentials used to authenticate with my server.
If all I have is a yes/no on whether the fingerprint matched, then I can't really secure anything with it.
Having "Enter Password" as an option on Touch ID popup that doesn't do anything is making this plugin almost useless in production environment. Is there any chance for this option to be implemented?
Thanks!!
Hello everyone.
I'm having an issue with this plugin, which I'm not sure it can be solved.
Here's the thing:
Our corporate App is open, no Fingerprint is configured.
I can logout and login to the App, and it won't ask me to use Touch ID.
Without closing the app, I browse to Touch ID menu, and add a fingerprint.
Then, getting back to my App, it should ask me if I want to use Touch ID on my next login, but it doesn't.
Is it possible for my app to recognize that a fingerpring has been added without having to close it and open again?
Thanks in advance guys!
Hi,
I've attempted to integrate your plugin but I am having some issues. When I call verifyFingerprint and attempt to use my finger to authenticate neither of the success or error callbacks get called.
If I choose the enter passcode option, this does work however. I think this might be due to an iOS API change because the same issue occurs with two other plugins I have tried (But yours is better suited for my needs).
Would be great if we could find out what has changed and patch it - thanks for your awesome work on the plugin.
Hi,
I am using touch-id plugin #3.2.0, Xcode #8.1 and iOS #10.11.6 . I need to customise the error handler popup which appears when customer using invalid finger print scan which is not saved in the device. Instead of 'Enter Passcode' and 'Cancel' option, can we use other ways to handle the authentication process like password or OTP and if so please explain how ?
Please help.
Hi Eddy,
I add TouchID and add support for "Passcode". It works good in development mode.
I release my app on TestFlight and the "Passcode" option changes to "Password".
My code is easy:
window.plugins.touchid.isAvailable(
function YesTouchidSupport()
{
window.plugins.touchid.verifyFingerprint(
"TouchID needed for this App",
authencationSuccessful,
authenticationFailed
);
},
function NoTouchidSupport(errorMessage)
{
alert("Device does not support TouchID");
}
);
I do something wrong?
Thanks,
Hans
how you detect whether the phone hardware supports fingerprint or not ?
This is my app.run code.
when this run it display white screen in my iphone
`app.run(function($ionicPlatform, $rootScope, $http,$window) {
$window.plugins.touchid.isAvailable(function() {
alert('available!');
// success handler: TouchID available
},
function(msg) {
alert('not available, message: ' + msg);
// error handler: no TouchID available
});
});`
i install plugin using npm
In case when device has a Touch ID or FaceID, but no fingerprints yet, isAvailable() calls the error handler with result: {"localizedDescription":"No identities are enrolled.","code":-7 }.
How I can determine type of biometric ID - 'touch' or 'face' in this case?
Thanks!
I'm using the latest version of Phonegap and the npm install of your plugin.
window.plugins.touchid.isAvailable(
function(){alert('available')}, // success handler: TouchID available
function(){alert('not available')} // error handler: no TouchID available
);
The error message works correctly in the browser and on Android, but the success alert isn't firing on my iPhone 6s.
This is my first day working with Phonegap so I have a bit of a curve.
Hallo @EddyVerbruggen!
I'm followed @ghost / @mabdelwahab / @harshvardhan12 comments:
--
I have used verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel to hide passcode button, but now i have a issue, if user has unsuccessful 5 attempts the touchid get disabled/locked for the device, is there a way to unlock without passcode, so that we can implement within the app
{
"localizedDescription": "Biometry is locked out.",
"code": -8
}
Steps
1) window.plugins.touchid.isAvailable
-->onSuccess ↓
2)window.plugins.touchid.didFingerprintDatabaseChange
-->onSucces ↓
3)window.plugins.touchid.verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel
(
'Bitte legen Sie Ihren Finger auf, um sich anzumelden',
'', // <------ hide PIN button
(msg2) => {
console.log('msg2', msg2);
},
errorCallback
);
original comment from #27
possible fix: https://stackoverflow.com/a/45613341
canEvaluatePolicy returns false on iPad's with registered biometry registered. Tested in iPad pro 10.3 on a ionic 1 project. Works fine in iPhone's.
Is it always the current iOS user? Can we specify which iOS user?
/Users/devmobile/Desktop/TouchID/workshop/platforms/ios/Workshop/Plugins/cordova-plugin-touch-id/TouchID.m:49:41: warning:
undeclared selector 'evaluatedPolicyDomainState' [-Wundeclared-selector]
if (![laContext respondsToSelector:@selector(evaluatedPolicyDomainState)]) {
^
/Users/devmobile/Desktop/TouchID/workshop/platforms/ios/Workshop/Plugins/cordova-plugin-touch-id/TouchID.m:54:33: error:
no visible @interface for 'LAContext' declares the selector
'evaluatedPolicyDomainState'
NSData * state = [laContext evaluatedPolicyDomainState];
~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
** BUILD FAILED **
The following build commands failed:
CompileC build/Workshop.build/Debug-iphonesimulator/Workshop.build/Objects-normal/i386/TouchID.o Workshop/Plugins/cordova-plugin-touch-id/TouchID.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/devmobile/Desktop/TouchID/workshop/platforms/ios/cordova/build-debug.xcconfig,-project,Workshop.xcodeproj,ARCHS=i386,-target,Workshop,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/devmobile/Desktop/TouchID/workshop/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/devmobile/Desktop/TouchID/workshop/platforms/ios/build/sharedpch
I have a requirement to save the touchid or faceid matches in the database so that we could make an api call that matches the finger print or faceid from the database.
Can you please guide me in this and share your experience ?
Hello.
I have iPhone 5s and I use window.plugins.touchid.verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel in PhoneGap app. App show TouchID screen but without enter PIN label.
What is wrong?
D.
Hi Eddy,
Its a very nice tutorial. If possible, please share the HTML templates and script file.
Thanks.
Ankush
Hi
If fingerprint is wrong will get try again, there Use PIN option will come
On click of that what will happen?
In 5s its doing nothing
Hello ..
When i used this plugin for touch id in phonegap.. touch id dialog prompt successfully ..
it also shows fail message but not showing success message..?
window.plugins.touchid.isAvailable(
function(msg) {
window.plugins.touchid.verifyFingerprintWithCustomPasswordFallbackAndEnterPasswordLabel(
'Scan your fingerprint please', // this will be shown in the native scanner popup
'Enter PIN', // this will become the 'Enter password' button label
function(msg) {
console.log("console "+msg);
$("#touchresponse").html(msg);
alert(typeof msg);
}, // success handler: fingerprint accepted
function(msg) {
$("#touchresponse").html(JSON.stringify(msg));
} // error handler with errorcode and localised reason
);
}, // success handler: TouchID available
function(msg) {
$("#touchresponse").html(JSON.stringify(msg));
} // error handler: no TouchID available
);
When do I call this function? I'm currently building an app which asks users for user and pass. I would love to add touchid but when should I first ask for fingerprint? After the first login I guess to be able to match fingerprint with credentials?
Does it work with PGB btw?
you recently added false argument to the "isAvailable" function in ur documentation, why?
and i noticed that no any new arguments to that function in TouchID.js
so what is the story? is that happened accidentally ?
I am getting an issue in callback function. When I checked in plugin the CDVCommandStatus_OK was returning "1". But, in JS success response I am getting null value.
[self.commandDelegate sendPluginResult:[CDVPluginResult resultWithStatus:CDVCommandStatus_OK]
callbackId:command.callbackId];
eg:-
window.plugins.touchid.isAvailable(
function(msg) {alert('ok: ' + msg)}, // msg I am getting Null value
function(msg) {alert('not ok: ' + msg)} // error handler: no TouchID available
);
When I install from npm using
$ cordova plugin add cordova-plugin-touch-id
$ cordova prepare
It doesn't modify the config.xml file. The following is not added to the config.xml. I hope thats normal...
<feature name="TouchID">
<param name="ios-package" value="TouchID" />
</feature>
But after a few tries the plugin stops working. And I get this error:
{localizedDescription: "The operation couldn’t be completed. (OSStatus error -25308.)", code: -25308}
Is there a way to authenticate several users and relate each id to a user?
App is crashing on verifyFingerprint
with error message Thread 21: EXC_BAD_ACCESS on the following line:
// Start the query and the fingerprint scan and/or device passcode validation
OSStatus userPresenceStatus = SecItemCopyMatching((__bridge CFDictionaryRef)query, NULL);
isAvailable
seems to be working correctly. I received an error message when no fingerprints were enrolled. I enrolled a fingerprint and received the success callback, so I called verifyFingerprint
and the debugger stopped on the line above.
I am using:
[email protected]
[email protected]
I have tried removing and reinstalling the plugin to no avail:
meteor remove cordova:cordova-plugin-touch-id
meteor remove-platform ios
meteor add-platform ios
meteor add cordova:[email protected]
i updated the plugin to support faceID and then giving me error while taking build.
Sometimes the popup never comes and shows the following error while deploying it in the device.
Following is the code:
`function iOSFingerPrint() {
window.plugins.touchid.isAvailable(
function() {
var auth = $base64.encode( $scope.user.username + ":" + $scope.user.password);
ss.set(
function (key) { console.log('Set ' + key); },
function (error) { console.log('Error ' + error); },
'token', auth);
isFingerprintsinPhone = true;
iOSFingerPrintPopUp();
}, // success handler: TouchID available
function(msg) {
isFingerprintsinPhone = false;
iOSFingerPrintPopUp();
if (isFromIosUserValidation == true) {
$scope.deleteFingerPrint();
isFingerprintsinPhone = false;
}
} // error handler: no TouchID available
);
}
function iOSFingerPrintPopUp() {
if (isFingerprintsinPhone == false) {
$scope.deleteFingerPrint();
} else if (isFingerprintsinPhone == true) {
// alert('It is here');
window.plugins.touchid.verifyFingerprint(
'Scan your fingerprint please', // this will be shown in the native scanner popup
function(msg) {
$scope.disableFingerPrint=false;
localStorage.setItem('hasEnrolledFingerprints',true);
localStorage.setItem('isFingerPrintRequired',true);
localStorage.setItem('notNullFlag',true);
$scope.myPopup6.close();
if (isFromIosUserValidation == true) {
$scope.showCartStatuspopUp();
}
}, // success handler: fingerprint accepted
function(msg) {
} // error handler with errorcode and localised reason
);
}
}`
I'm using phonegap build to build the app, since yesterday I got this error for ios build:
Error - The following 3rd-party plugin is causing the build to fail and may need to be updated to a newer version: cordova-plugin-touch-id
cordova-plugin-touch-id | npm | 3.3.1
I'm using
PhoneGap (iOS / Android / Windows)
cli-7.0.1 (4.4.0 / 6.2.3 / 5.0.0)
Is it possible to get an ID or name of the fingerprint it was matched with?
Is there any way to check if the touch id has been enrolled for ios using ionic like for android?
when installing the plugin using npm or github
$ cordova plugin add cordova-plugin-touch-id`
$ cordova prepare
or
$ cordova plugin add https://github.com/EddyVerbruggen/cordova-plugin-touch-id
$ cordova prepare
using cordova browser the plugin seems to work, but for mobile device (iPhone 6, iOs 9) the plugin does not seem to load at all.
Thanks,
I accidentally pressed the home button while I was trying to verify my fingerprint and received this error message:
Fingerprint or device passcode could not be validated. Status -25293.
Not sure if this is an issue with the plugin or just a failure of Touch ID. Just wanted to report the finding.
Hi Eddy,
Great Plugin! Was wandering if you plan to also support to enter the password from the Touch ID screen? Or maybe also that it will be possible to disable the "Enter password" function.
Thanks in advance!
is it also possible to perform touch or face verification in the background ?
meaning, i would like to escape any kind of (native) modal, dialog or overlay.
thanks !
window.plugins.touchid.isAvailable(...)
calls the error handler if a device has a TouchID/FaceID scanner, but no fingerprints. This is different from the most popular Android plugin for this purpose. It would be very nice to be able to determine if a device has a TouchID/FaceID scanner in order to provide messaging to encourage the user to add a fingerprint/faceprint.
I have a cordova project that uses the latest version (3.3.1) of this plugin and I tested my app on an iPhone X.
My app was originally written to use the TouchID to login users to the app, but since this plugin automatically supports FaceID, it worked without me having to adjust any of my code.
The issue is that the FaceID works perfectly the first time it is used but whenever a user logs out of the app and tries to re-login using the FaceID feature, the entire phone freezes and has to be rebooted.
This issue does not occur on older iPhones supporting TouchID.
I cannot find any error messages when debugging the app. Please advise.
Hi,
I followed the document for manual process to add touch id, But in the console its throwing
Window.plugins.touchid is undefined...can anyone tell why the error is?
Status -25293 code is to identify the tigger point when touchId get invalidated. After this point you will have to enter PIN to validate.
It's a useful but I am not getting this code in iPhone 5s and iPhone 6. It's working in iPhone 6 plus.
/Plugins/cordova-plugin-touch-id/TouchID.m:54:33:
error: no visible @interface for 'LAContext' declares the selector 'evaluatedPolicyDomainState' NSData * state = [laContext evaluatedPolicyDomainState];
1 warning and 1 error generated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.