Apache Milagro MFA JS Lib Incubator

Clone this repo:



  1. ee2107a Merge pull request #6 from miracl/multiProtocols by bbvox · 2 years ago master
  2. c8b7bae Merge pull request #4 from miracl/updateCrypto by bbvox · 2 years ago
  3. 5590da8 Preparation for support multi authentication protocols by boyan.bakov · 2 years ago
  4. f105200 Make the js-lib to work with maas mobile flow (#5) by Pavlin Angelov · 2 years ago
  5. f33c5a1 Update reference to milagro-crypto & remove bower version by Boyan Bakov · 2 years, 1 month ago

Headless M-Pin Client Library

Requirement for build & testing

  1. Nodejs
  2. Grunt
  3. Mocha
  4. Bower


$ git clone
$ cd project_folder
$ npm install
$ grunt build

Simple usage example

  • Registration
var mpin = mpinjs({server: <serverIP-and-port>});



mpin.startRegistration(<userId>, <callback>);

/* Wait for end-user to confirm identity */

mpin.confirmRegistration(<userId>, <callback>);

/* If successful, read desired user secret (PIN or password) */

mpin.finishRegistration(<userId>, <user-secret>);

  • Authentication
mpin.startAuthentication(<userId>, <callback>);

/* If successful, read user secret (PIN or password) */

mpin.finishAuthentication(<userId>, <user-secret>, <callback>);
  • Authentication with a mobile device

/* Display Access number to end user */

mpin.waitForMobileAuth(<timeout-sec>, <retry-period-sec>, <callback>);

   If successfull - Authentication completed
   If exits with timeout, then no successfull authentication from mobile device was completed
   If one needs to cancel the waiting for authentication from the mobile device, call cancelMobileAuth()

Running Tests

Install development dependencies:

$ npm install


$ npm test

Actively tested with node:

  • 0.10.4