Client JS Library

MIRACL Trust provides a JavaScript library that lets you implement custom verification flows that best suit your use case - MIRACL Trust Client JS Library.

As a preliminary step, you need to configure the verification.

To register the device, your web application must consume the Verification URL obtained by the verification request. This URL can then be directly returned to the application where the verification process is completed.

Another option is to send the URL to the end user via any appropriate secure channel (email, SMS, etc.).

Use the received verification URL and the getActivationToken method of the library to get an activation token and register the browser:

mcl.getActivationToken(
  "https://yourdomain.com/verification/confirmation?userId=alice@miracl.com&code=theVerificationCode",
  function callback(err, result) {
    if (err) {
      // Handle any potential errors
    }

    console.log(result.actToken);
  },
);

To finish the registration, call the register method using the received activation token (actToken):

mcl.register(
  userId,
  actToken,
  function (passPin) {
    // Here you need to prompt the user for their PIN
    // and then call the passPin argument with the value
    passPin(pin);
  },
  function callback(err) {
    if (err) {
      // Handle any potential errors
    }
  },
);

If the registration is successful, the enrolment process is completed. End users can now authenticate using the PIN chosen for the device. They can go through the verification process for each device they want to use for authentication or use QuickCode, if enabled, to enrol additional devices using the already enrolled one.