How to enable JWT authentication for Zowie Widget?

Zowie Widget (JS, iOS, Android, React Native) supports authentication of end-user session via JWT token. We recommend using RS256 algorithm and the payload to have the following structure:

{
   "sub": "USER’S UNIQUE ID",
   "iat": 1516239022,
   "firstName":"USER’S LAST NAME",
   "lastName":"USER’S FIRST NAME",
   "email":"USER’s EMAIL",
   "extraParams":{
      "tier":"101",
      "shopName":"Bike Store",
      "userType":"employee",
      "sessionToken":"ABCEDF12345",
   }
}

The most important part of JWT token is sub field. This is a field that will be used by Zowie as unique identifier for conversation. If we verify that JWT token is valid, we will use sub field to determine conversation and allow this user to access the whole history of conversation under this chat.

📘

We recommend, that sub field will be your unique customer/user ID.

What are the steps to enable JWT authentication for your widget?

  1. Generate a pair of private and public keys for RSA 256 JWT algorithm.
  2. Share with Zowie public key so we can configure authentication verification on your account.
  3. Make sure that you will generate JWT token on the backend side of your application and pass it as argument to our Zowie SDK.

How to pass JWT token to Zowie Widget?

Please refer to SDK specific documentation:

SDKDocumentation
JSLINK
iOSLINK
AndroidLINK
React NativeLINK