Identity verification makes sure that conversations between you and your customers are kept private and that someone else can't impersonate another.

We strongly encourage everyone to set up and enable identity verification.

The Identity verification is a JSON web token, and should be created on your server side.

📘

Info:

The Key for creating the token is your department's API secret.

The token is signed using:

HMAC-SHA256

🚧

Note:

You must enable Require identity verification in the Web Chat settings of all your departemnts.

Standard JWT Claims

NameDescription
IssuerUUID. The API key (lowercase)
AudienceUUID. The unique identifier of the customer (lowercase)
ExpirationToken expiration datetime in UTC. We recommend at least 5 hours from creation.

The "aud" claim should have the same value as the uniqueidentifier parameter of the widgetOptions object. The unique identifier value should be a valid UUID.

You determine the uniqueidentifier which should be stored on your server side. If, for example, you have a user named "[email protected]" with a corresponding uniqueidentifier of "db79e775-81fd-4f2e-8741-9266e920cc32", then every time this user logins, the value should be the same.

Optional Claims

NameDescription
field1If a ticket is opened, this value will be set for field1.
field2If a ticket is opened, this value will be set for field2.
field3If a ticket is opened, this value will be set for field3.
field4If a ticket is opened, this value will be set for field4.

You can also add your own custom claims in the token. These values will be present in the identityTokenClaims object in the ticket details (The max length of the serialized identityTokenClaims to JSON is 500).

Example

{
    "iss": "7cab072d-43d0-4e9d-bb25-2a947696fe8f",
    "iat": 1539766700,
    "exp": 1571386631,
    "aud": "db79e775-84f2e-8741-9266e920cc32",
    "sub": "",
    "field1" : "John"
}

This Online JWT Builder will help get you started.

After creating the token, pass it, together with the customer's "uniqueidentifier", like this:

 <!-- Start of Glassix Chat Widget -->
<script>
var widgetOptions = {
     apiKey: "7cab072d-43d0-4e9d-bb25-2a947696fe8f",
     snippetId: "dr548fbb5d61ec51869a",
     uniqueIdentifier: "db79e775-81fd-4f2e-8741-9266e920cc32",
     identityToken: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ..."
};

(function(n){var u=function(){GlassixWidgetClient&&typeof GlassixWidgetClient=="function"?(window.widgetClient=new GlassixWidgetClient(n),widgetClient.attach(),window.glassixWidgetScriptLoaded&&window.glassixWidgetScriptLoaded()):f()},f=function(){r.src="https://cdn.glassix.net/clients/widget.1.2.min.js";r.onload=u;document.body.removeChild(t);i.parentNode.insertBefore(r,i)},i=document.getElementsByTagName("script")[0],t=document.createElement("script"),r;(t.async=!0,t.type="text/javascript",t.crossorigin="anonymous",t.id="glassix-widget-script",r=t.cloneNode(),t.onload=u,t.src="https://cdn.glassix.com/clients/widget.1.2.min.js",!document.getElementById(t.id)&&document.body)&&(i.parentNode.insertBefore(t,i),t.onerror=f)})(widgetOptions)
</script>
<!-- End of Glassix Chat Widget -->