# Recipe: OneLogin with Tableau

## Scope

My goal is to setup OneLogin as the Identity Provider for Tableau Server. I want to synchronise users from Active Directory to Tableau and OneLogin; then use those accounts to sign in with SAML to Tableau. Simple, right?

## OneLogin Developer Tenant

First off, sign up for a free OneLogin developer account. This gives me the ability to test out all the features I need.

{% embed url="<https://www.onelogin.com/developer-signup>" %}
Click the link to get your OneLogin developer account here!&#x20;
{% endembed %}

## Tableau Server Identity Store

During Tableau setup I have configured Active Directory as the External Identity store. So before I can authenticate with a user, I need to ensure there is actually a user account created within Tableau. I used the [Tableau AD Users and Group Sync ](https://help.tableau.com/current/server/en-us/users_manage_ad.htm)to import *Adam.Wally* from Active Directory. The Tableau username is based on the `sAMAccountName` attribute in AD:

![AD user account properties](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fc79fd31e832fd6ab5271607b62e49f7f15ffa3e8.png?generation=1613428323726960\&alt=media)

So when imported:

![Tableau Users administration table](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F6cbd41cc446e6c8d63efbecbfd54105adc73eafa.png?generation=1613428319336917\&alt=media)

As described [here](https://help.tableau.com/v2020.4/server/en-us/security_auth.htm)...If you configure Tableau Server to use Active Directory during installation, then NTLM will be the default user authentication method. So my test with `Adam.Wally` proved I could authenticate with my AD username and password.

## Active Directory and OneLogin Directories

I did not want to manually populate OneLogin with user accounts, so I saw they had an [Active Directory Connector](https://onelogin.service-now.com/kb_view_customer.do?sysparm_article=KB0010442) and decided to use that.

The Active Directory Connector was straightforward to download and setup. The connections were all outbound so in my lab it just worked straight away, you know how labs do. However, in an Enterprise you will need to configure the network security for your proxy or egress. So for any OneLogin agent, domains, ip addresses and ports are listed [here](https://onelogin.service-now.com/support?id=kb_article\&sys_id=e1899821db8c60103de43e0439961952\&kb_category=a0b5e130db185340d5505eea4b961957)... *Use **IP whitelisting** for on-premises agents, like Active Directory Connector*

![ADC download option](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F762e8d87ed0b8034bda46131c23342f653198f76.png?generation=1613428323120182\&alt=media)

Once downloaded the setup is simple. I chose the Create OneLogin Service Account option by inputting a password to setup the account via the wizard.

![ADC setup service account option](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F332c6fdf742cb6137e1b2efe30f139aeaecb9ce7.png?generation=1613428319505710\&alt=media)

![Builtin\Administrators service account](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F7035d4d1d212723601211d7144b86e7df54dbb7f.png?generation=1613428318317142\&alt=media)

*...It creates a domain service account named OneLoginADC with Builtin\Administrators credentials in the local Domain...* This was fine in my lab but I would follow the principle of least privilege in production and there is an article to guide you on how to [Create a Domain Service Account to run Active Directory Connector](https://onelogin.service-now.com/support?id=kb_article\&sys_id=e73c3a35dbf0441024c780c74b961909).

The ADC Setup also configures OneLogin Desktop SSO feature, now called [Windows Domain Authentication](https://onelogin.service-now.com/kb_view_customer.do?sysparm_article=KB0010313). This allows for Integrated Windows Authentication if you require it for Windows and Mac desktops. Not a feature I required in my scenario but a default part of the ADC setup.

![Windows Domain Authentication port](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Faf612888da01df081a33dbcf228cf29d6f5c41f9.png?generation=1613428317468539\&alt=media)

The setup is a little confusing here, as it refers to selecting the domains, but also includes the Users container. I just followed with the choice as is.

![Domain selection for sync](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F7143c16fa9592f70b863a2ae2703e3fa2bb4277b.png?generation=1613428322694634\&alt=media)

Once the setup is complete you go back to the OneLogin portal and is gives you the option to select the OU's/Containers that you would like to synchronise. Always, when I am testing a directory sync I start small. I know I only have 100 test users in my OU so know this should be a pretty quick exercise. I have seen many customers try to sync their entire domain and get into issues with large directories. Start small, test early and then incrementally add if you have 1000s of objects.

![Portal user import option](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Ff4b593736f9cef6f9f262c77bb75b08c3e85a70d.png?generation=1613428323398774\&alt=media)

![ADC Connector status in portal](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fbc1fd877f06d358d3f99db7ae1625a427dc455f4.png?generation=1613428319845280\&alt=media)

Even though the ADC sync was communicating with the Onelogin service. I did not have any new users in the directory. When I check the logs in `C:\Program Data\OneLogin, Inc\logs` I was getting an error about missing attributes.

![Missing attributes in the logs](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F02a5ca326ac9c015570612502f534593253486ff.png?generation=1613428321846625\&alt=media)

The attributes shown below are required and luckily I knew straight away that my lab users didn't have an email address.

![Required sync attributes from AD to OneLogin](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F63bd22dd857c540d3aaadcb7358f036ae0c56cb6.png?generation=1613428321120996\&alt=media)

I added the email address for one of my AD users re-synced and away we went!

![awally](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F4663a3c4e3568e7edfc88372c73d61cd0359d53d.png?generation=1613428323097689\&alt=media)

So the synchronisation is working, now I just need to setup SAML to test signing in with this user.

### Advanced Settings

After a time I found I was being continually prompted for password expiry. I figured this wasn't driven from AD as I was manually changing the password and still getting prompted. You can check advnaced settings on the directory sync and there are a whole host of configuration options so I advise reviewing before deploying. The offending one for me was this one which was enabled by default:

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2F-MXd76a_D2frUw4DcJme%2F-MXd7YGSXG4PAwp4MhrQ%2Fimage.png?alt=media\&token=b56b30c8-bda3-437a-b6f4-9417506b4f93)

## Tableau Server-Wide SAML setup

The standard setup instructions for Tableau Server are below:

{% embed url="<https://help.tableau.com/current/server/en-us/config_saml.htm>" %}

The obvious steps apply of defining your entity ID, uploading certificates and sharing of metadata between Tableau as the service provider and OneLogin as the Identity Provider.

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fab215db170a9c88abde6f5e8776e7b29a7bf3f60.png?generation=1613428318517630\&alt=media)

### Certificates

I chose to use the same certificates I used for the Server SSL. In addition to [all the normal requirements](https://help.tableau.com/current/server/en-us/saml_requ.htm#Certific) for your SSL certificate you [also need to ensure that](https://help.tableau.com/current/server/en-us/saml_requ.htm#Cert_Name) your certificate for SAML only includes the certificate that applies to Tableau Server and not any other certificates or keys.

## Onelogin Apps and SAML

There are a lot of Tableau apps in the Onelogin directory. I selected the **Tableau Server SAML 2.0** app. *This was my first mistake ;)*

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Ff57c5f78f13586aad2e1a2d4ff1bbc5f4de17a40.png?generation=1613428317689603\&alt=media)

Once installed I was looking for an option to upload metadata but there isn't (similar to Okta). So the only option I had was to define the Server Name and protocol, it seemed strange as normally I would have to input the Entity ID **and** ACS when configuring Tableau Online with an IdP, but I ploughed on regardless *(mistake #2)*.

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F9572a1d455ac910b9d8a04cdbc448099486973dd.png?generation=1613428317307391\&alt=media)

The default settings for SAML 2.0, included a Standard Strength Certificate and SHA-1 signing algorithm. All of this information I was able to download in the metadata and then import into Tableau.

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fda95693f8e7d1a4b368de76ea83ec9f69b269af5.png?generation=1613428318043660\&alt=media)

The user attribute mappings are pretty simple for Tableau.

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F05a084752c98e982c554351c29fd4fad2b2e4096.png?generation=1613428321899550\&alt=media)

After uploading the metadata I applied the pending changes in Tableau which required a service restart. I love 'em. I wanted to test a basic SAML configuration without adding in things like SLO or different client SAML options.

![My favourite progress bar.](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F65e7a737b1acb5cbbb66f9c8ab2afbfb64d93001.png?generation=1613428320756579\&alt=media)

The services restarted and I attempted my first sign in and... FAIL!\
The error I was getting was:

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fb1bb1297be04ce95d31db36ba90c49f56859f1c1.png?generation=1613428320246939\&alt=media)

I attempted both an IdP-initiated sign on and SP-initiated and got the same error.

## Troubleshooting

I reset the password in OneLogin and checked that I could sign in. I checked the account in OneLogin and I made sure that I was 'Authenticated by' OneLogin and **not** Active Directory. If it was set to Active Directory I could use my AD username and password to sign in.

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fbde8ac5ca6076920e0d4749d36fcd8729240ff12.png?generation=1613428316689757\&alt=media)

In Tableau I wanted to check the usernames in the Identity Store. Weirdly, I couldn't find a simple way to do this, as I had enabled Server-Wide SAML and was automatically being redirected to the OneLogin portal for all authentication requests. I looked at using **tabcmd** but couldn't see an obvious cmd that just listed users (maybe I missed something). Also TSM doesn't contain user information it is only the higher-level server configuration that is managed from the portal.

I found these [instructions](https://kb.tableau.com/articles/howto/exporting-user-list) to access the Server Repository which is a PostgreSQL database. This is a lot of work but I found it useful to look at the underlying database. A quicker method with no server restart would be to connect via the [REST API](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_get_started_tutorial_intro.htm) and get the information.

I had to ensure I had network access on port 8060 and run a tsm command first as explained [here](https://help.tableau.com/current/server/en-us/perf_collect_server_repo.htm).

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F1ec9f2840ad924bbeead4bd3b8f824124fdf3dab.png?generation=1613428319122229\&alt=media)

![Connection details](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fe8c8741387074fddfba74f74f2c835bfc67532a1.png?generation=1613428322167609\&alt=media)

Once I had connected I could then browse the \_users table:

![The \_users table in all its glory](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Ff2f8839dcc6920588e42805531678d51cc11f777.png?generation=1613428321572773\&alt=media)

I checked I was passing the value in the Name column as the username attribute in SAML (*adam.wally*). This corresponds with the sAMAccountName shown at the top of the article in AD and mapped in OneLogin. I'm a big fan of [SAML-tracer for Firefox](https://addons.mozilla.org/en-US/firefox/addon/saml-tracer/) and Chrome. This showed I was passing the correct attribute:

![SAML-tracer SAML summary](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F08e23bc9f2f03c904c2f56ffcece8324f518d92a.png?generation=1613428320899755\&alt=media)

The next step was to look at the logs on the Tableau side to see if there was anything obvious reported.

{% embed url="<https://help.tableau.com/current/server/en-us/saml_trouble.htm>" %}

To log SAML-related events, `vizportal.log.level` must be set to `debug`. For more information, see [Change Logging Levels](https://help.tableau.com/current/server/en-us/logs_debug_level.htm).

```
tsm configuration set -k vizportal.log.level -v debug
tsm pending-changes apply

tsm configuration set -k vizportal.log.level -d
tsm pending-changes apply
```

Check for SAML errors in the following files in the unzipped log file snapshot:`\vizportal\vizportal-<n>.log`

![Ahh, no valid audiences...?](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F80b4f3f6241163c37071d27727c75a0d0f2cfc91.png?generation=1613428318150785\&alt=media)

I did some searching for the error message but I wasn't clear what Audiences was referring to. I then did what I probably should have done at the start and seen if someone else had already set this up. I found this [great article](https://medium.com/@kannanmadhav/configuring-saml-for-tableau-server-with-onelogin-3e9a58cb2931) by a colleague of mine Madhav Kannan that identified my issue. At the very start I had chosen the wrong OneLogin Tableau app. I need to have chosen **Tableau Server(Signed Response)**.

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fe1f10d1a0f6c1e3fc9d831f969bb701e6e966483.png?generation=1613428322613737\&alt=media)

This allows me to configure what OneLogin refers to as the SAML [Audience](https://support.okta.com/help/s/article/Common-SAML-Terms?language=en_US), but we reference as the value **Entity ID**.

![Remember this from the Tableau SAML configuration?](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fe62957408ab8948f4f24cb8d8e0369e53c235f4e.png?generation=1613428317021195\&alt=media)

So this time the OneLogin app makes more sense.

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F2b88cde7516093e59798d644bc9f8542f717e8c8.png?generation=1613428316889309\&alt=media)

## Client Exceptions

I mentioned earlier that with Server-Wide SAML configured every user had to authenticate using SAML, there is no mixed authentication methods. However, there is an interesting feature within the SAML configuration that allows you to apply exceptions for the Desktop client.

![](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F21ec245facc777fa1c5ed47a5b966a2ff646ea9a.png?generation=1613428321425944\&alt=media)

> There is updated guidance around Mobile client option shown above as it no longer works for newer clients: \
> Allow using SAML to sign in from older versions of Tableau Mobile app. Devices running Tableau Mobile app version 19.225.1731 and higher ignore this option. To disable devices running Tableau Mobile app version 19.225.1731 and higher, disable SAML as a client login option on Tableau Server.

When I choose to sign in to the Tableau Server using the desktop client I get challenged by the normal SAML flow (shown below).

![SAML Authentication via Desktop client](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fc7492502d651d2a2fab8067faf2b7dd567b34b3d.png?generation=1613428319943413\&alt=media)

By **deselecting** the SAML sign in from Tableau Desktop the flow reverts to the username/password or NTLM AuthN.

Unfortunately it requires a server restart so go get a cup of tea.

![Oh, ok.](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F4c26b11618ce6072c785b7c9b14cb2c73e59e468.png?generation=1613428318872630\&alt=media)

After the restart you will see that the login prompt has changed from being redirected to your SAML IdP, to the normal Tableau server prompt. You will then be able to sign in with your AD/LDAP credentials or Tableau Local username and password.

![Sign in with your AD credentials or basic username/password](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F812283db14ead7bd43086546375c07ed24c681e7.png?generation=1613428320960244\&alt=media)

## Single Logout

After logging on to the server I noticed I did not have option to sign out of Tableau. Tableau Server and Tableau Online supports Single Logout (SLO) for server-wide SAML (only SP-initiated not IdP-initiated). If you have configured Site SAML in Tableau Server neither SP or IdP-initiated are supported.

This feature is enabled by importing the SAML SLO Endpoint as part of the OneLogin IdP metadata. However despite uploading the correct metadata it was not available:

![How can I sign out?](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2F861fa9cacd70173c79e173c9b7df7bd68f3bf688.png?generation=1613428318663093\&alt=media)

Looking at the OneLogin metadata XML below you can see there are different HTTP methods defined for SLO and SSO, *redirect* and *post* respectively.

![HTTP Redirect](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fcb1eb4ffe0b3e7d3890b5e2f1a2fcd8a2f8d14b4.png?generation=1613428322431437\&alt=media)

As our [SAML Requirements](https://help.tableau.com/current/server/en-us/saml_requ.htm#xml_requirements) documentation states... **\*\*\_**&#x48;TTP POST\*\*: Tableau Server accepts only HTTP POST requests for SAML communications. HTTP Redirect is not supported.\_ Unfortunately this means SLO is not currently going to work with OneLogin.

### **How it should work:**

![My nice shiny Sign Out](https://3088636806-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTNc1yqFWMiF2_FfNrL%2Fsync%2Fb90d75cba0b666496fecc9933b94d59a75fabef1.webp?generation=1613428319998577\&alt=media)

## Conclusion

### OneLogin

Getting Active Directory sync'ed up to OneLogin was surprisingly easy in my little lab which is a good sign. I like the outbound ADC agent, (similar to the Azure connectors) in not requiring reverse proxies. Naturally it would take a lot more planning in an Enterprise but if you get stuck in a lab that would be more concerning. The number of Tableau apps in OneLogin is confusing so pay attention and pick the right one, ...do what I say not what I do!

### SAML

If you setup Server Wide SAML then know that it means **all accounts** and you can't login with any other AuthN method. So, ensure all necessary accounts are sync'ed into your IdP (such as admins) or be ready to disable SAML for a workaround.

### **Single Logout**

With the lack of Single Logout, I don't see this as an issue for many users where speed is important by just closing a browser; but with more advanced users who are used to signing out as good practice this may come as a surprise. However, this does highlight a risk around [session hijacking ](https://owasp.org/www-community/attacks/Session_hijacking_attack)particularly in shared computer or embedded scenarios. Standard mitigations for this would be configuring the browser or running a job to regularly delete persistent cookies and session cookies, and then use threat detection and security in depth with TLS and anti-malware.
