Seamless Tableau App Access: Skip the Login Prompt with SAML Auto-Login
Suppose you want to provide your users with a direct link to a dashboard, bypassing the SAML IdP login prompt if they are already authenticated with the SAML provider. Since the user hasn’t logged into Tableau yet, they are currently being asked to click the Tableau Login button, which is less than optimal.
Normally SAML SSO just works when embedding Tableau and iframe authentication is enabled and allowed on the IdP.
However for the cases when the access to a dashboard is initiated via a button click (e.g Okta tiles), the SSO login will work, but the user will end up on the Tableau landing page, rather than the expected dashboard page. If that’s your use case, this solution may help.
This solution is a simple web app that facilitates automatic SAML SSO login to your Tableau dashboard. It’s ideal for scenarios where users are already authenticated with a SAML IdP.
Unlike JWT-based authentication, this solution requires no backend. Simply host the HTML file or share it with your users.
TLDR: Git repo https://github.com/alexeski/tableaudisplay-saml-autologin
Use Cases
- Tableau Display: Imagine using digital signage software to display your Tableau dashboard on a large screen, which leverages SAML to sign in with a service account on various apps that rotate through the Display screen. With our solution, you can automatically log in to your dashboard without having to manually enter your credentials every time. Simply open the HTML file, and our solution will take care of the rest.
- SAML App Catalog Integration: If you have a SAML app catalog portal (e.g., Okta), you can use our solution to integrate your Tableau dashboards directly into the catalog. When users click on the dashboard tile within the catalog, they’ll be redirected to the dashboard without requiring additional logins, assuming they’re already signed in to the SAML SSO provider and Tableau Cloud or Tableau Server is connected to the same provider.
- Intranet CMS pages: say you add links that take to Tableau dashboards hosted on various different Tableau Cloud / Server sites, each of them using their own saml config.
How it works
The solution uses a small HTML file that can be hosted on a web server or run locally. When you open the file, it retrieves the necessary parameters from the URL, constructs a dynamic URL for your Tableau dashboard, and opens a popup for SSO authentication. But here’s the clever part: we use a “window trick” to handle the SAML authentication in a popup. This allows us to bypass the usual login prompt and take the user directly to the dashboard (kudos to Anthony Alteirac for finding this trick a couple years ago).
The Window Trick
The window trick involves opening a popup window that handles the SAML authentication. This popup window is closed after a few seconds, and the user is redirected to the Tableau dashboard. The key to this working is that the popup must be allowed by the browser. If popups are blocked, the solution won’t work.
Here’s a snippet of the code that shows how we construct the dynamic URL and open the popup:
const dynamicUrl = `https://${pod}/t/${siteName}/views/${workbook}/${view}?:embed=y&:toolbar=n`;
window.trick = window.open(
`https://sso.online.tableau.com/public/sp/login?alias=${entityId}`,
"AuthPopup", "width=500,height=600,toolbar=no,location=1,directories=1,status=no,menubar=no,scrollbars=1,resizable=1"
);
What is the Entity ID?
The Entity ID is a unique identifier for your Tableau Cloud or Tableau Server instance. It’s used to identify your instance to the SAML IdP and is required for SAML authentication to work. You can find the Entity ID in the Tableau SAML settings page, it looks like this: a2aecbc1-54e9-4ab0-975c-05eb6f237e8f
. Make sure to replace this value with your own Entity ID in the code.
Get Started
To use this solution, simply clone our GitHub repository and customize the parameters to fit your needs. You can hardcode the parameters in the code or pass them in the URL to customize the dashboard view.