Search code examples
tableau-api

Embed Tableau with Authentication


I have a requirement to embed a tableau report into another web page. We are using the tableau JS:

http://onlinehelp.tableau.com/current/server/en-us/embed_code.htm

Question is: Is there an authentication option whereby our application (web page) can pass authentication credentials to Tableau so the user does not need to enter the credentials?

Thanks!


Solution

  • You are probably looking for the Trusted Authentication, as described here:

    When you embed Tableau Server views into webpages, everyone who visits the page must be a licensed user on Tableau Server. When users visit the page they are prompted to sign in to Tableau Server before they can see the view. If you already have a way of authenticating users on the webpage or within your web application, you can avoid this prompt and save your users from having to sign in twice by setting up trusted authentication.

    There is also an example showing how to use it:

    If you are working with Tableau Server, and if the server is configured to use trusted authentication, specify the ticket in the URL by first adding trusted after the server name, followed by the ticket. For example:

    var placeholderDiv = document.getElementById("tableauViz");
    var url = "http://tabserver/trusted/Etdpsm_Ew6rJY-9kRrALjauU/views/workbookname/viewname";
    
    var options = {
       hideTabs: true,
       width: "800px",
       height: "700px"
    };
    
    var viz = new tableau.Viz(placeholderDiv, url, options);