πŸ”‘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:

Hint : If You Select A Step That The Customer Did not Enter While Onboarding This Customer

Must Update this Information First Using Update Plugin Before Authentication.

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 :

level of Trust token Is The One You Copied In The Previous Step

Applicant Id : You Have To Determine The ID Of The Applicant To Authenticate You Can Find This Id In The Data Returned Back To You In The Callback URL

post
Authorizations
Header parameters
Accept-LanguageStringOptional
Body
tenantIdstring | nullableOptional
tenantSecretstring | nullableOptional
applicantIdstring | nullableOptional
levelOfTrutTokenstring | nullableOptional
Responses
200
Success
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
  }
});

You Can Check For Available Error Codes At Errors

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
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
}

You Can Check For Available Status Codes At Status

Last updated