Tableau Connector for Salesforce

Build 23.0.8839

Configuring a Connection

After Installing the Connector you can connect and create a Data Source for data in Salesforce.

Setting Up a Data Source

Complete the following steps to connect to the data:

  1. Under Connect | To a Server, click More....
  2. Select the data source called Salesforce by CData.
  3. Enter the information required for the connection.
  4. Click Sign In.
  5. If necessary, select a Database and Schema to discover what tables and views are available.

Using the Connection Builder

The connector makes the most common connection properties available directly in Tableau. However, it can be difficult to use if you need to use more advanced settings or need to troubleshoot connection issues. The connector includes a separate connection builder that allows you to create and test connections outside of Tableau.

There are two ways to access the connection builder:

  • On Windows, use a shortcut called Connection Builder in the Start menu, under the CData Tableau Connector for Salesforce folder.
  • You can also start the connection builder by going to the driver install directory and running the .jar file in the lib directory.

In the connection builder, you can set values for connection properties and click Test Connection to validate that they work. You can also use the Copy to Clipboard button to save the connection string. This connection string can be given to the Connection String option included in the connector connection window in Tableau.

Connecting to Salesforce

By default, the connector connects to production environments. Set UseSandbox to true to use a Salesforce sandbox account. If you are using user/password authentication, ensure that you specify a sandbox username in User.

Authenticating to Salesforce

User Credentials and a Security Token

Set the AuthScheme to Basic and set the User and Password to your login credentials. Additionally, set the SecurityToken. By default, the SecurityToken is required, but you can make it optional by configuring a range of trusted IP addresses in Salesforce.

To disable the security token:

  1. Log in to Salesforce and enter Network Access in the Quick Find box in the setup section.
  2. Add your IP address to the list of trusted IP addresses.

To obtain the security token:

  1. Open the personal information page on Salesforce.com.
  2. Click the link to reset your security token. The token will be emailed to you.
  3. Specify the security token in the SecurityToken connection property or append it to the Password.

OAuth

AuthScheme must be set to OAuth in all user account flows.

Desktop Applications

CData provides an embedded OAuth application that simplifies OAuth desktop Authentication. Alternatively, you can create a custom application. See Creating a Custom OAuth App for information on creating custom applications and reasons for doing so.

For authentication, the only difference between the two methods is that you must set two additional connection properties when using custom OAuth applications.

After setting the following connection properties, you are ready to connect:

  • InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
  • OAuthClientId: (custom applications only) Set to the Client ID in your application settings.
  • OAuthClientSecret: (custom applications only) Set to the Client Secret in your application settings.

When you connect, the connector opens the OAuth endpoint in your default browser. Log in and grant permissions to the application. The connector then completes the OAuth process as follows:

  • Extracts the access token from the callback URL.
  • Obtains a new access token when the old one expires.
  • Saves OAuth values in OAuthSettingsLocation so that they persist across connections.

OAuth Password Grant

Follow these steps to set up the Password Grant option:

  1. Set the AuthScheme to OAuthPassword to perform authentication with the password grant type.
  2. Set all the properties specified in either the web or desktop authentication sections above.
  3. Set the User and Password to your login credentials, as well as the SecurityToken if required.

Note: If you have enabled Session Settings > Lock sessions to the IP address from which they originated, make sure that your IP address does not change while using the connector. If the IP changes during the usage of the connector, an "INVALID_SESSION_ID" error is returned from Salesforce and the connector will no longer be able to retrieve data. If you receive this error, ask your Salesforce administrator to disable this configuration or make sure to configure a static IP for the instance where you are using the connector. Then, reset the connection to continue using the connector. 

OAuthJWT Certificates

Set the AuthScheme to OAuthJWT.

OAuthJWT

To obtain the OAuthJWT consumer key:

  1. Log in to Salesforce.com.
  2. From Setup, enter Apps in the Quick Find box and then click the link to create an app. In the Connected Apps section of the resulting page, click New.
  3. Enter a name to be displayed to users when they log in to grant permissions to your app, along with a contact Email address.
  4. Click Enable OAuth Settings and enter a value in the Callback URL box. Set this value only to create the Connected App as it is required. It will not actually be needed for this type of authentication. The Callback URL is in the format:
    http://localhost:8019/src/oauthCallback.rst
  5. Enable Use digital signatures.
  6. Upload your certificate.
  7. Select the scope of permissions that your app should request from the user.
  8. Click your app name to open a page with information about your app. The OAuth consumer key is displayed.

After creating your OAuth Application, set the following connection properties:

  • AuthScheme: Set to OAuthJWT.
  • InitiateOAuth: Set to GETANDREFRESH.
  • OAuthJWTCert: Set this to the JWT Certificate store.
  • OAuthJWTCertType: Set this to the type of the certificate store specified by OAuthJWTCert.
  • OAuthJWTCertPassword: Set this to the Password of the JWT Certificate store.
  • OAuthJWTIssuer: Set this to the OAuth Client ID.
  • OAuthJWTSubject: Set this to the username (email address) to the permitteed User Profile configured in the OAuth Connected App.

Note: This flow never issues a refresh token.

AzureAD

Set the AuthScheme to AzureAD. Use the following connection properties to connect to AzureAD:

  • SSOExchangeUrl: The Salesforce OAuth 2.0 token endpoint for the identity provider. This can be found in the Salesforce account settings by navigating to Administration Setup > Security Controls > SAML Single Sign-On Settings and then choosing the desired organization.

Note that this configuration requires two AAD applications: the "Salesforce" application used for single sign-on, and a separate "connector" application with user_impersonation permission on the "Salesforce" application. You must also specify the OAuth connection properties:

  • OAuthClientId: The application Id of the connector application, listed in the Overview section of the app registration.
  • OAuthClientSecret: The client secret value of the connector application. Azure AD displays this when you create a new client secret.

Use the following SSOProperties to authenticate to AzureAD:

  • Resource: The application Id URI of the Salesforce application, listed in the Overview section of the app registration. In most cases this is the URL of your custom Salesforce domain.
  • AzureTenant: The Id of the Azure AD tenant where the applications are registered.

The following is an example connection string:

AuthScheme=AzureAD;InitiateOAuth=GETANDREFRESH;OAuthClientId=3ea1c786-d527-4399-8c3b-2e3696ae4b48;OauthClientSecret=xxx;SSOProperties='Resource=https://example.my.salesforce.com;AzureTenant=6ee709df-9de0-4cdf-10e6b7a51d95';

Okta

Set the AuthScheme to Okta. Use the following connection properties to connect to Okta:

  • User: Set this to the Okta user.
  • Password: Set this to Okta password for the user.
  • SSOLoginURL: Set this to the login url used by the SSO provider.
  • SSOExchangeUrl: The Salesforce OAuth 2.0 token endpoint for the identity provider. This can be found in the Salesforce account settings by navigating to Administration Setup > Security Controls > SAML Single Sign-On Settings and then choosing the desired organization.
In SSOProperties, when required, set these input parameters:
  • APIToken (optional): Set this to the API Token that the customer created from the Okta org. You should use this when authenticating a user via a trusted application or proxy that overrides OKTA client request context.
  • MFAType (optional): Set this only in case you have configured MFA flow. Currently we support only the following types: OktaVerify, Email, and SMS.
  • MFAPassCode (optional): Set this only in case you have configured MFA flow. If this is set to empty/invalid the driver initially issues a MFA challenge that triggers the platform to send you a one-time password on your device or email, based on the configured MFA type. You need to re-issue another connection where the retrieved one-time password value is passed to MFAPassCode connection property.

The following is an example connection string:

AuthScheme=PingFederate;User=PingFederateUserName;Password=PingFederatePassword;URL='http://sharepointserver/mysite';

OneLogin

Set the AuthScheme to OneLogin. Use the following connection properties to connect to OneLogin:

  • User: Set this to the OneLogin user.
  • Password: Set this to OneLogin password for the user.
  • SSOExchangeUrl: The Salesforce OAuth 2.0 token endpoint for the identity provider. This can be found in the Salesforce account settings by navigating to Administration Setup > Security Controls > SAML Single Sign-On Settings and then choosing the desired organization.
You need the following SSOProperties to authenticate to OneLogin:

  • OAuthClientId: Set to the OAuthClientId, which you can obtain by selecting Developers > API Credentials > Credential > ClientId.
  • OAuthClientSecret: Set to the OAuthClientSecret, which you can obtain by selecting Developers > API Credentials > Credential > ClientSecret.
  • Subdomain: Set to the subdomain of the OneLogin user accessing the SSO app. For example, if your OneLogin URL is splinkly.onelogin.com, enter splinkly as the subdomain value.
  • AppId: Set to the Id of the SSO app.
  • Region (optional): Set to the region your OneLogin account resides in. The OneLogin API operates in multiple regions and this property is used to find the correct domain. It can take one of the following values:
    • US (default)
    • EU

The following is an example connection string:

AuthScheme=OneLogin;User=OneLoginUserName;Password=OneLoginPassword;SSOProperties='OAuthClientID=3fc8394584f153ce3b7924d9cd4f686443a52b;OAuthClientSecret=ca9257fd5cc3277abb5818cea28c06fe9b3b285d73d06;Subdomain=OneLoginSubDomain;AppId=1433920';

PingFederate

Set the AuthScheme to PingFederate. The following connection properties need to be set:

  • User: Set this to the PingFederate user.
  • Password: Set this to PingFederate password for the user.
  • SSOLoginURL: Set this to the login url used by the SSO provider.
  • SSOExchangeUrl: The Salesforce OAuth 2.0 token endpoint for the identity provider. This can be found in the Salesforce account settings by navigating to Administration Setup > Security Controls > SAML Single Sign-On Settings and then choosing the desired organization.
Among SSOProperties to authenticate to PingFederate:

  • AuthScheme (optional): The authorization scheme to be used for the IdP endpoint. The allowed values for this IdP are None or Basic.
Additionally, you can use the following SSOProperties to configure mutual SSL authentication for SSOLoginURL, the WS-Trust STS endpoint:
  • SSLClientCert
  • SSLClientCertType
  • SSLClientCertSubject
  • SSLClientCertPassword
Below is an example connection string:
AuthScheme=PingFederate;User=pingFederateUser;Password=pingFederatePassword;SSOLoginURL='https://<authority>/idp/sts.wst';SSOExchangeUrl='https://domain.my.salesforce.com/services/oauth2/token?so=00D3000006JDF';

ADFS

Set the AuthScheme to ADFS. The following connection properties need to be set:

  • User: Set this to the ADFS user.
  • Password: Set this to ADFS password for the user.
  • SSOLoginURL: Set this to the login url used by the SSO provider.
  • SSOExchangeUrl: The Salesforce OAuth 2.0 token endpoint for the identity provider. This can be found in the Salesforce account settings by navigating to Administration Setup > Security Controls > SAML Single Sign-On Settings and then choosing the desired organization.

You need the following SSOProperties to authenticate to ADFS:

  • RelyingParty: This attribute is the value of the Relying Party Identifier on the ADFS server for Salesforce.
Below is an example connection string:
AuthScheme=ADFS;User=username;Password=password;SSOLoginURL='https://sts.company.com';SSOProperties='RelyingParty=https://saml.salesforce.com';

ADFS Integrated

The ADFS Integrated flow indicates you are connecting with the currently logged in Windows user credentials. To use the ADFS Integrated flow, do not specify the User and Password, but otherwise follow the same steps in the ADFS guide above.

Next Step

See Using the Connector to create data visualizations.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 23.0.8839