Login with JSON Web Token (JWT)
Plan: Business Users

In a nutshell: this is bring your own users. You can integrate feedback users from your backend system such that feedback is linked directly to users of your product/service. User data shall be integrated via JWT and appear as feedback user in Productific. 

JSON Web Tokens (JWT) are an industry standard for representing and transferring claims between two parties. JWT are URL-safe and are typically used to integrate user login data across web applications. Details are described in RFC7519. Productific uses JWT to link other products' user data such that feedback can be directly attributed to known users. The following steps describe how to set up Single Sign On (SSO) with JWT for a product feedback page. 

Guide: How to setup SSO login via JWT for your product feedback page

Step 1: Enable SSO in the settings section of your Productific dashboard: activate "Login via SSO (JWT)" and generate a new secure token. Optionally, you can maintain a login URL. When a login URL is maintained Productific can send your users there to sign in, without a login URL maintained the link "Sign in with..." won't be shown.

Step 2: Include this script so you can sign users into Productific. This javascript does the Productific login for you. 

<script src="https://productific.com/cdn/productific-users.js"></script>

Step 3: Generate a JWT token
in your product (on your server) which is then used by Productific to sign in users. For security reason: stay in the backend, do not do this in the browser.

function generateJWT(user) {  
  const payload = {
    // the name of your product 
    // (see Productific dashboard - settings - vanity URL)
    product: 'MyProduct',

    // the ID that your product uses to identify this user
    id: user._id,

    // the user's email 
    email: user.email,

    // the user's name
    name: user.firstName + ' ' + user.lastName,

    // optional: family name
    familyName: user.lastName,

    // optional: given name
    givenName: user.firstName,

    // optional: URL of user's image 
    photoUrl: user.photoUrl
  return JWT.sign(payload, 'your_secret_key', {algorithm: 'HS256'});

Step 4: Use the JWT to sign in with Productific by running the following javascript:

    // the name of your product (see Productific dashboard - settings)
    // the token obtained in step 3
    jwt, // the token optained in step 3

    // callback, this one opens the feedback page after successful login
    function() { window.open('https://productific.com/@MyProduct','_blank'); }, 

    // debug mode: 'true' leads to supportive javascript console output

Optional: Single-Sing-On via JWT is typcially used in two flavours:

  • Without login page (embedded):
    SSO by passing auth tokes when sending users from inside your product via URL link over to Productific.

  • With login page:
    SSO by sending users to your product login page when logging into Productific.

Both flavours can be combined and used in parallel. 

Compatibility: Productific allows you to integrate users from your system, from just about any platform: Node.js, Java, Ruby, Android, iOS, Angular, .... Just check the libraries listed on jwt.io to pick one for your stack.