/qlik-cloud-jwt

JavaScript boilerplate for connecting to Qlik Cloud using JWT authorization identity configuration

Primary LanguageJavaScript

"Authorize Users with JWTs for Qlik Embedded" - Authorization and Embedding Examples

✨ Updated: October 2021
✨ Published: October 2021

This example is referenced in the tutorial Implement JWT Authorization on qlik.dev. It is recommended to use this tutorial in combination with this example.


By authorizing users with JWTs, you can embed analytics from Qlik into your own web applications using your host application's access control model.

Adding authorization to Qlik tenants and web applications using JWTs and JavaScript

JWT icon JavaScript icon Qlik logo

Developer Use-Cases

If you are developing apps that integrate analytics, this sample is going to accelerate rendering analytics content based on your use case.

Upon implementing JWT authorization to Qlik, there are a number of ways to add embedded content:

  • JavaScript embedded visualization using nebula.js
  • iframe embedded visualization using the single API
  • Connect to REST endpoints when you need to in your web application front-end

User Work Flow

When you add authorization to Qlik using JWTs the goal is to abstract away the login experience to a Qlik Cloud tenant. As a developer the last thing you want is to have an end user redirected to an interactive login when the solution is embedded. JWT authorization enables users to have a seamless experience with embedded Qlik content.

Setup

Qlik Cloud tenant

  1. Obtain access to a Qlik Cloud Enterprise tenant with JWT authorization capabilities.

  2. Complete the tutorial for creating signing keys and configuring JWT authorization on the tenant.

Remix this project

Remix on Glitch

Add the private key to the remixed project

  1. Copy to the clipboard the contents of the private key file generated in step 2 of the Qlik Cloud Tenant section of this readme.

  2. In your remixed project, click on the New File button and in the input field type in .data/private.key.txt.

NewFile

  1. Press the Add This File button to have it open in the editor. Paste the private key into the Glitch editor window. This adds the private key to a project directory that is not copied during a remix.

AddThisFile

  1. Ensure the path and file reference to the private key file is properly reflected in the token.js file so your JWT is properly signed.

Update environment variables

Update the environment variables in the .env section of Glitch, or in the config.js file.