Steps to securely embed Tableau Dashboards in custom Web applications

The Problem

Tableau is used to create Rich Visualizations including interactive graphs and charts and we can combine them in a dashboard and worksheet to share with business users.

Integrating or embedding the created worksheet or dashboard from Tableau in an external application is not as straightforward. Tableau offers an embed link feature but If we access the dashboards in other applications with embed links then the login page appears requiring a user to login to Tableau before the content can be displayed. 

The Solution

Tableau Server provides an application programming interface (API) that lets you programmatically manage users, workbooks, data connections, and much more.

Here are some of the things that can be done with the JavaScript API:

  • Display visualizations from Tableau Server, Tableau Public, and Tableau Online in web pages.
  • Dynamically load and resize visualizations.
  • Filter the data displayed in visualizations with HTML controls in the page.
  • Select marks in visualizations.
  • Respond to events in visualizations.

Export visualizations to an image or PDF file.

In this article, we describe a Security Integration approach using the trusted token and Tableau JavaScript API to help integrate Tableau visualizations into your own web applications without a login prompt appearing.

Note: you need to make sure that client browsers must be configured to “allow third-party cookies” if you are going to use trusted authentication with embedded views.

Configuration settings

User Creation

First we need to make sure the user is created and assigned to a respective site role in Tableau Server.

The below Figure 1.1 shows the user got created in Tableau server and assigned a Site role to it.

External Application Server Setup

We need to register the respective web application server Host/IP Address by adding it to the Tableau Server.

The below Figure 1.2 shows added Application server url under Trusted Authentication Section in Tableau server.

Retrieve the Trusted Token from Server

Inorder to retrieve the trusted token from the Tableau server we need to make use of JavaScript API in your web page from external application.

Below are the elements which we require to make use in the JavaScript API in a webpage.

  • Username: The username which we used to get loggin.
  • Server: the address of your Tableau Server, e.g., https://server_name.
  • Client IP (optional): Application server IP which should be added in Tableau server.
  • Site: The name of the Tableau Server site that the user is a member of.

The below Figure 1.3(Code) Illustrate the retrieval of trusted token from the Tableau server using JavaScript API

// Param Declaration

    var token=’’;

     var body = {

            “username”: ,

            “server”: ,

            “client_ip”: ,

            “target_site”: ,//If not mentioned it will take default as built.

 };

$.ajax({

     type: “POST”,

url: +”/trusted”,

               data: jQuery.param(body),

contentType: ‘application/x-www-form-urlencoded; charset=UTF-8’,

    success: function(result) {

        //return with token

         Token = result;

         console.log(‘Token request is Successful’);

    },

    error: function (e) {

        console.log(‘Token request is Unsuccessful’,e);

         

      }

});

.Figure 1.3(Code)

Embed the dashboard to your own application

Now we can access the dashboard content with the help of the retrieved trusted token.

First we should construct the URL with the unique trusted token generated and retrieved using Javascript API to access  the dashboard in your own application.

NOTE: If you are accessing a Tableau Server with a single site vs a server that hosts multiple sites the URL syntax may differ.

The below Figure 1.4(Single Site URL) illustrates the construction of  the url to access the Dashboard using retrieved trusted token in our own application webpage.

https:///trusted//views//

.Figure 1.4(Single Site URL)

 

The below Figure 1.5(multiple Sites URL) illustrates the construction of  the url to access the Dashboard using retrieved trusted token in our own application webpage.

https:///trusted//t//views//

.Figure 1.5(multiple Sites URL)

Summary

The Tableau JavaScript API allows you to do several things with Tableau: Embed data visualizations from Tableau Server, Tableau Public, and Tableau Online inside of web pages. Filter the data inside the visualizations using HTML controls. Using the trusted token approach described is one of the simplest ways of embedding Tableau developed content in other applications.

Shopping Basket

MicroFocus Vertica Analytics Platform delivers speed, scalability, and built-in machine learning that today’s most analytically intensive workloads demand, whether in the Public Clouds, On-Premises, on Hadoop, or any Hybrid combination. Vertica’s SQL Data Warehouse is trusted by the world’s leading data-driven companies, including Cerner, Etsy, Intuit, Uber and more to deliver speed, scale and reliability on mission-critical analytics. Vertica combines the power of a high-performance, massively parallel processing SQL query engine with advanced analytics and machine learning so you can unlock the true potential of your data with no limits and no compromises. We are a certified System Integration and reseller partner of Vertica and have a strategic alliance to develop industry-specific solutions using this Award-winning Columnar Database in the APAC region.

We have extensive experience with the entire product suite having successfully completed over 50 implementations in the USA/Europe/Asia Pacific across different industries and still continue to support a few key customers Globally.

As a Future-ready and complete, enterprise-grade analytics platform, Pyramid is a compelling option for organizations. Pyramid offers an integrated suite for modern Analytics and Business Intelligence requirements. It has a broad range of analytical capabilities, including data wrangling, ad hoc analysis, interactive visualization, analytic dashboards, mobile capabilities and collaboration in a governed infrastructure. It also features an integrated workflow for system-of-record reporting. Its Augmented features such as Smart Discovery, Smart Reporting, Ask Pyramid (NLQ), AI-driven modelling, automatic visualizations and dynamic content offer powerful insights to all users, regardless of skill level and the adaptive augmented analytics platform covers the entire data life cycle out-of-the-box, from ML-based data preparation to automated insights and automated ML model building. Pyramid is especially useful for the customer who is in urgent need to get more value out of their existing SAP BW and SAP HANA investments. Without any data extraction or duplication, Pyramid offers best-in-class functionality and performance that preserves the security and governance inherent in the SAP platform. We are a Strategic System Integration and Reseller partner of Pyramid Analytics.