πAuthentication
1. First We Need To Setup Level Of Trust :
This Setup Allow Us To Configure How Customer Can Authunticate When Using The Plugin.
A. Go To Level Of Trust Page In Your Admin Panel And Click Add new Level Of Trust Button

B. Enter A Name For Level Of Trust And Select Steps To Authenticate Customers:

C. After Creation Of New Level Of Trust Just Copy The Level Of Trust Id To Use In Next Steps:

2. Create Session Token For Authentication:
Second Step When Customer Needs To Verfy (his/her) Identity You Have To Initialize Session By Creating Session Token Using The Following API :
post
Authorizations
Header parameters
Accept-LanguageStringOptional
Body
tenantIdstring | nullableOptional
tenantSecretstring | nullableOptional
applicantIdstring | nullableOptional
levelOfTrutTokenstring | nullableOptional
Responses
200
Success
400
Bad Request
post
POST /api/v1/Auth/GenerateAuthRequestSessionToken HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 88
{
"tenantId": "text",
"tenantSecret": "text",
"applicantId": "text",
"levelOfTrutToken": "text"
}
{
"token": "text",
"expirationDate": "2025-06-30T16:20:20.592Z"
}
3. Import eNROLL JS File in index.html :
<script src="eNROLL.min.js"></script>
4. Add Div Element With Specifying Id For This Div
<div id="myDiv">
</div>
5. Initialize eNroll Component Any Where In Your JS File After Document Is Loaded:
eNROLL.init({
elementId:"myDiv", // The Id We Set Before For Our Div
url:"{{environment.url}}", // this parameter is sent to you by email after acceptiong your org
mode:"auth",
sessionId://Token We Got In Step 1 From The API,
onComplete:()=>{
// define What Happen When User Complete Auth
},
onError:(errorCode,message)=>{
// define What Happen When User Fild At Auth
// You Can Check For This Code To Take the Correct Action
},
onExit:()=>{
// define What Happen When User Exit From eNROll Plugin
}
});
6. As A FInal Step You Can Verfiy The Current Status Of this Authentication Using The Following API:
post
Authorizations
Header parameters
Accept-LanguageStringOptional
AuthorizationstringOptional
ex: Bearer
Responses
200
Success
400
Bad Request
post
POST /api/v1/authentication/AuthenticationRequest/GetAuthenticationReport HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
{
"applicantId": "text",
"applicantName": "text",
"nationalIdNumber": "text",
"passportDocumentNumber": "text",
"levelOfTrustId": "text",
"levelOfTrustName": "text",
"status": 1
}
Last updated