# 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.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
accessId
string
# 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
# sendVerificationEmail
Start the verification process for a specified user ID (must be email)
# Parameters
# getActivationToken
Finish the verification process
# Parameters
verificationURI
string The URI received in the email containing the verification codecallback
function (Error, Object)
# register
Create an identity for the specified user ID
# Parameters
userId
string The ID of the useractivationToken
string The code received from the verification processpinCallback
function Called when the PIN code needs to be enteredcallback
function (Error, Object)
# authenticate
Authenticate the user with the specified user ID
# Parameters
userId
string The ID of the useruserPin
string The PIN of the identitycallback
function (Error, Object)
# generateAuthCode
Authenticate the user and receive an authorization code as a result
# Parameters
userId
string The ID of the useruserPin
string The PIN of the identitycallback
function (Error, Object)
# generateOTP
Fetch an OTP for the specified user ID
# Parameters
userId
string The ID of the useruserPin
string The PIN of the identitycallback
function (Error, Object)
# generateQuickCode
Fetch a registration (bootstrap) code for the specified user ID
# Parameters
userId
string The ID of the useruserPin
string The PIN of the identitycallback
function (Error, Object)
# sign
Create a cryptographic signature of a given message
# Parameters
userId
string The ID of the useruserPin
string The PIN of the identity used for authenticationmessage
string The message that will be signedtimestamp
number The creation timestamp of the messagecallback
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
Returns boolean Returns true if the state of the user matches the state argument
# get
Get a property of the user
# Parameters
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