mAccess - TrustBuilder MFA library (JavaScript/Typescript) for mobile v3.3.1
The mAccess Library is a small JavaScript library that lets you perform simple operations (OTP, Activation, PIN operations..) with your TrustBuilder MFA service. This library is intended for mobile integrations use only like Ionic / Apache Cordova / Adobe Phonegap, this document explains how to add mAccess to your mobile app.
if you intend to implement TrustBuilder MFA access in a browser or a web view, please refer to the following documentation: mAccess library (WEB / Javascript) (browser version)
Prerequisites / Before we start
An TrustBuilder MFA service
A valid "Alias" for a secure site for this service, and requested during script initialization
mAccess Library - script elements
Importing mAccess Library
The library can be downloaded from the following location: https://ult-inwebo.com/neon/3.3.1/neon-lib.min.js
Copy neon-lib.min.js directly into your source folder, you can then import it like this:
import * as Neon from "../../providers/neon-lib.min.js"
mAccess Library - script configuration
You need to provide:
a secure site alias (see in the last section, how to get a secure site alias with the administration console)
an app description
a serial number that uniquely identifies the instance of application for the current user
const serial = "application serial";
const secureSiteAlias = "9e0fdfe690254502348155f063bdcc42";
const appDescription = "My First App";
const configuration = {
serverUrl: "https://ult-inwebo.com",
appVersion: '1.0.0',
serial: serial,
dataAppli: 'neonWeb',
kFactory: "a2f436dd91f7e1693079c0b41fcbc3235d1dcdd22d0cbceaf0bec8878f68503efe44d8a49142aa84fceca8dd696462a5cdd5f75528cd6789cf098277faeef42d4c407a36e7d7e9e8cd1571bb13c9b7af71c9d671f2b75270573ed6a19a10656503685873e811cec661515b31fe8ebfa58ba19b0124cdd69047993e9d60562631",
macId: '0'
};
this.iw = new Neon.IW(configuration);
this.activities = new Neon.SimpleActivities(this.iw, secureSiteAlias, appDescription);
Initialization
activities.init();
Results
Allows you to Initialise the Neon library and returns a promise that resolves a logins array containing all the accounts already enrolled and active for this alias in this browser
List of available operations with mAccess Library
activateWithPin(code: string, pin: string, onSuccess: (login: string) => {}, onError: (error: any) => {})
getOnlineOtpWithPin(login: string, pin: string, onSuccess: (otp: string) => {}, onError: (error: any) => {})
getOfflineOtpWithPin(login: string, pin: string, onSuccess: (otp: string) => {}, onError: (error: any) => {})
getActivationCodeWithPin(login: string, pin: string, onSuccess: (code: string) => {}, onError: (error: any) => {})
unlockTokenWithPin(login: string, code: string, pin: string, onSuccess: () => {}, onError: (error: any) => {})
changePin(login: string, oldPin: string, newPin: string, onSuccess: () => {}, onError: (error: any) => {})
resetPin(login: string, resetCode: string, newPin: string, onSuccess: () => {}, onError: (error: any) => {})
sealDataWithPin(login: string, pin: string, dataToSeal: string, onSuccess: (otp: string) => {}, onError: (error: any) => {})
Operation with mAccess Library
activateWithPin
activities.activateWithPin(code: string, pin: string, onSuccess: (login: string) => {}, onError: (error: any) => {})
Enroll an account in this brower:
{string} code The activation code delivered by TrustBuilder service
{string} pin The user's PIN code of the account
{function} onSuccess The success callback
{function} onError The error callback
getActivationCodeWithPin
activities.getActivationCodeWithPin(login: string, pin: string, onSuccess: (code: string) => {}, onError: (error: any) => {})
Get an activation CODE for an enrolled user
{string} login The login of the account
{string} pin The pin of the account
{function} onSuccess The success callback
{function} onError The error callback
getOnlineOtpWithPin
activities.getOnlineOtpWithPin(login: string, pin: string, onSuccess: (otp: string) => {}, onError: (error: any) => {})
Generate an OTP
{string} login The login of the account
{string} pin The pin of the account
{function} onSuccess The success callback
{function} onError The error callback
getOfflineOtpWithPin
activities.getOfflineOtpWithPin(login: string, pin: string, onSuccess: (otp: string) => {}, onError: (error: any) => {})
Generate an OTP
{string} login The login of the account
{string} pin The pin of the account
{function} onSuccess The success callback
{function} onError The error callback
unlockTokenWithPin
activities.unlockTokenWithPin(login: string, code: string, pin: string, onSuccess: () => {}, onError: (error: any) => {})
Unlock an enrolled user
{string} login The login of the account
{string} unlockCode The unlock code delivered by TrustBuilder service
{function} onSuccess The success callback
{function} onError The error callback
changePin
activities.changePin(login: string, oldPin: string, newPin: string, onSuccess: () => {}, onError: (error: any) => {})
Change the pin of an account
{string} login The login of the account
{string} oldPin The pin of the account
{string} newPin The new pin of the account
{function} onSuccess The success callback * {function} onError The error callback
resetPin
activities.resetPin(login: string, resetCode: string, newPin: string, onSuccess: () => {}, onError: (error: any) => {})
Reset the pin of an account
{string} login The login of the account
{string} resetCode The reset code delivered by TrustBuilder service
{string} newPin The new pin of the account
{function} onSuccess The success callback
{function} onError The error callback
sealDataWithPin
activities.sealDataWithPin(login: string, pin: string, dataToSeal: string, onSuccess: (otp: string) => {}, onError: (error: any) => {})
Seal data
{string} login The login of the account
{string} pin The pin of the account
{string} data The data to seal
{function} onSuccess The success callback
{function} onError The error callback
Creating a secure site Alias for your "mAccess" App with the Administration console
in the first column of the "secure site" tab in your Administration console
Add a secure site type... "Web services"
In the Authentication page indicate the URL address page using mAccess JS library
Select "Browser Token Activation" to generate a Bookmark Alias.
Save this Bookmark ALIAS to use in your page for initiating mAccess JS library
Error codes
ERROR VALUES |
---|
USER_IS_BLOCKED, |
USER_IS_NOT_BLOCKED, |
USER_MULTI_CUSTOMER, |
USER_NOT_MONO_SERVICE, |
USER_ENTRY_DOES_NOT_EXIST, |
APP_ALIAS_ENTRY_DOES_NOT_EXIST, |
PUSH_ALIAS_ENTRY_DOES_NOT_EXIST, |
TOKEN_IS_BLOCKED, |
TOKEN_IS_NOT_BLOCKED, |
TOKEN_TYPE_IS_NOT_SUPPORTED, |
TOKEN_HAS_NO_BIO_KEY_AND_SERVICE_MUST_USE_BIOKEY, |
THIS_KEYTYPE_IS_NOT_ALLOWED, |
STATIC_TOKEN_KEY_IS_INVALID, |
DYNAMIC_TOKEN_KEY_IS_INVALID, |
MAX_NB_TOOLS, |
NO_ACTIVE_SERVICE_FOR_USER, |
NO_PASSWORD, |
PASSWORD_IS_WRONG, |
BIO_KEY_IS_WRONG, |
BIO_KEY_ALREADY_EXIST, |
NO_DEVICE_FOUND, |
NOT_MACHINE, |
DEVICE_LOCKED, |
NO_ACCESS, |
MACID_IS_UNKNOWN, |
CODE_TYPE_NOT_SUPPORTED, |
CODE_ENTRY_DOES_NOT_EXIST, |
CODE_IS_NOT_ALLOWED_FOR_THIS_TOKEN, |
ACCOUNT_DATA_DOES_NOT_EXIST, |
TOKEN_DATA_DOES_NOT_EXIST, |
SEALING_IS_NOT_ALLOWED, |
SEALDATA_IS_NOT_VALID, |