Client certificate authentication for your Cordova app.
npm install cordova-plugin-client-certificatePlugin that uses a client certificate for authentication.
$ git clone https://github.com/mwaylabs/cordova-plugin-client-certificate.git
Create a new Cordova Project
$ cordova create hello com.example.helloapp Hello
Install the plugin
$ cd hello
$ cordova plugin add ../cordova-plugin-client-certificate
Copy a client certificate to your www/ folder.
Edit www/js/index.js and add the following code inside onDeviceReady
``js
var success = function(message) {
alert(message);
}
var failure = function(error) {
alert("Error:" + error);
}
clientCertificate.register("certfilePath/cert.p12", "s3cr37", success, failure);
``
Install iOS platform
cordova platform add ios
Run the code
cordova run
For more information on setting up Cordova see the documentation
For more info on plugins see the Plugin Development Guide