MIRACL Trust MFA JS

# Client

# Parameters

  • options Object

    • options.server string Server address, defaults to https://api.mpin.io

    • options.projectId string MIRACL Trust project ID

    • options.seed string Hex encoded random number generator seed

    • options.deviceName string Name of the current device

    • options.userStorage Object Storage for saving user data

    • options.oidc Object Parameters for initializing an OIDC auth session

      • options.oidc.client_id string OIDC client ID
      • options.oidc.redirect_uri string OIDC redirect URI
      • options.oidc.response_type string OIDC response type. Only ‘code’ is supported
      • options.oidc.scope string OIDC scope. Must include ‘openid’
      • options.oidc.state string OIDC state
    • options.cors bool Enable CORS requests if set to ’true’

    • options.requestTimeout number Time before a HTTP request times out in miliseconds

# setAccessId

Set the access(session) ID

# Parameters

# fetchAccessId

Make a request to start a new session and fetch the access(session) ID

# Parameters

  • userId string The ID of the user that will be authenticating (not required)
  • callback function (Error, Object)

# fetchStatus

Request for changes in status

# Parameters

# sendPushNotificationForAuth

Start the push authentication flow

# Parameters

  • userId string The ID of the user that will be authenticating
  • callback function (Error, Object)

# sendVerificationEmail

Start the verification process for a specified user ID (must be email)

# Parameters

  • userId string The email to start verification for
  • callback function (Error, Object)

# getActivationToken

Finish the verification process

# Parameters

  • verificationURI string The URI received in the email containing the verification code
  • callback function (Error, Object)

# register

Create an identity for the specified user ID

# Parameters

  • userId string The ID of the user
  • activationToken string The code received from the verification process
  • pinCallback function Called when the PIN code needs to be entered
  • callback function (Error, Object)

# authenticate

Authenticate the user with the specified user ID

# Parameters

# generateAuthCode

Authenticate the user and receive an authorization code as a result

# Parameters

# generateOTP

Fetch an OTP for the specified user ID

# Parameters

# generateQuickCode

Fetch a registration (bootstrap) code for the specified user ID

# Parameters

# sign

Create a cryptographic signature of a given message

# Parameters

  • userId string The ID of the user
  • userPin string The PIN of the identity used for authentication
  • message string The message that will be signed
  • timestamp number The creation timestamp of the message
  • callback function (Error, Object)

# Users

User management utility. Initialized by Client

# Parameters

# exists

Check if an user with the specified user ID exists

# Parameters

  • userId string The ID of the user

Returns boolean

# is

Check if an user is in a specific state

# Parameters

  • userId string The ID of the user
  • state string The state to check for

Returns boolean Returns true if the state of the user matches the state argument

# get

Get a property of the user

# Parameters

  • userId string The ID of the user
  • userProperty string The name of the property to be fetched

Returns string The value of the user property. Will return undefined if property doesn’t exist

# list

List all identities

Returns Object

# remove

Remove an identity

# Parameters

  • userId string The ID of the user