Implement Single sign-on

To implement the Single Sign-on option, the Insticator team will set up the SSO option. Your Account manager will provide you with a secret API key:

Step 1:
Collect secret APIkey setup for your domain(website). Note that the key is unique to each domain/website.

Step 2:
Hash and Encrypt data to create a unique SSO token for each user.

We require email, name, and the unique user id from your system. After you’ve got secret apiKey, create a concatenated string as shown below ( User email;secretKey). See the below example.

[email protected];07fd1128962801921a2a24a57cf4ada6

Then use any JS package SHA512 algorithm, which will produce a signature: See below example.


Create a JSON payload with Userdata and signature. User data fields ( UUID, Name, and Email - lowercase)

UUID - Any unique identifier that represents a user in your system (alphanumeric value). For e.g. it could be a subscriberId, customerId, any other internal reference that is unique.
Name - First name and Last name of the end-user ( This is used for Display name in comment unit).
Email - Email address associated with the end-user.

{"uuid": "12asd2323", "name": "Sample User Name", "email": "[email protected]", "signature":"81ce38b7df94822ce6cc6a44b88bdb630932d753e31c95a57601e5d3d8cf412125080e53e484dfa43767c56f7ce4524bae66287ad377f61ddf912f429646c982"}

Generating the SSO token is the last stage of the process. Encode the JSON payload with base64 (using UTF8 encoding) to generate the token which will be passed as a JS function in the next step. here is a sample code - DO NOT USE.


Step 3:

This code can be placed anywhere between the Insticator header code and the first Insticator product body code on the page). See below code snippet.

window.Insticator.load('customSSO', {
    SSOToken: '',
    openAuth: function () {}

Where SSOToken is the token you’ve generated in the previous step, and openAuth is the function that is going to be called, when a not logged user clicked the ‘Log in’ button in one of the Insticator products on your page.

For example, let's place it right after the Insticator header code. So you will have something like this on your page. ( e.g. token - DO NOT USE)

 <script data-cfasync="false"
   type="text/javascript">(function (a, c, s, u) { 'Insticator' in a || (a.Insticator = { ad: { loadAd: function (b) { }, q: [] }, helper: {}, embed: {}, version: "4.0", q: [], load: function (t, o) { Insticator.q.push({ t: t, o: o }) } }); var b = c.createElement(s); b.src = u; b.async = !0; var d = c.getElementsByTagName(s)[0]; d.parentNode.insertBefore(b, d) })(window, document, 'script', '')</script>
 <script async type="text/javascript"
   window.Insticator.load('customSSO', {
     openAuth: function () { alert('Please, log in via the form') }

 <div class="insticator-unit type-products">
   <div class="insticator-ads">
     <div id="div-insticator-ad-cmt-1"></div>
     <div id="div-insticator-ad-cmt-2"></div>
     <script data-cfasync="false"
   <div id="insticator-commenting">
     <div class="instiengage-comments" data-cu-uuid="{cuUuid}" data-ext-page-id="{extPageId}"></div>
   <div class="insticator-ads additional">
     <div id="div-insticator-ad-cmt-3"></div>
     <div id="div-insticator-ad-cmt-4"></div>
     <script data-cfasync="false"

Step 4:
Test the flow to see insticator product load ( For e.g. Comment unit should show up on the page where it’s tested). The user can confirm the login information and can now provide comments. The Single Sign-on option implementation is completed.