Configuring a Connection
After Installing the Connector you can connect and create a Data Source for data in SAP Ariba.
Setting Up a Data Source
Complete the following steps to connect to the data:
- Under Connect | To a Server, click More....
- Select the data source called SAP Ariba by CData.
- Enter the information required for the connection.
- Click Sign In.
- 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 SAP Ariba Source 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 SAP Ariba
Set the following to connect:
- API: Specify which API you would like the connector to retrieve SAP Ariba data from. Select the Supplier, Sourcing Project Management, or Contract API based on your business role.
- DataCenter: The data center where your account's data is hosted.
- Realm: The name of the site you want to access.
- Environment: Indicate whether you are connecting to a test, sandbox, or production environment.
If you are connecting to the Supplier Data API or the Contract API, additionally set the following:
- User: Id of the user on whose behalf API calls are invoked.
- PasswordAdapter: The password associated with the authenticating User.
Finally, if you're connecting to the Supplier API, set ProjectId to the Id of the sourcing project you want to retrieve data from.
Authenticating to SAP Ariba
Authentication to SAP Ariba APIs is handled via OAuth. SAP Ariba's OAuth flow requires no user interaction.
OAuthClient
Set the AuthScheme to OAuthClient.
You need to register an application with the service to obtain the APIKey, OAuthClientId and OAuthClientSecret.
See Creating a Custom OAuth App for information about creating an application.
InitiateOAuth defaults to GETANDREFRESH for the OAuthClient authentication scheme.
Automatic OAuth
Get and Refresh the OAuth Access Token
After setting the following, you are ready to connect:
- APIKey: The Application key in your app settings.
- OAuthClientId: The OAuth Client Id in your app settings.
- OAuthClientSecret: The OAuth Secret in your app settings.
When you connect, the connector automatically completes the OAuth process:
- The connector obtains an access token from SAP Ariba and uses it to request data.
- The connector refreshes the access token automatically when it expires.
- The OAuth values are saved in memory relative to the location specified in OAuthSettingsLocation.
Manual OAuth
Get an OAuth Access Token
Set the following connection properties to obtain the OAuthAccessToken:
- APIKey: The Application key in your app settings.
- OAuthClientId: The OAuth Client Id in your app settings.
- OAuthClientSecret: The OAuth Secret in your app settings.
Then call the GetOAuthAccessToken stored procedure. Set the GrantType input to client_credentials or openapi_2lo (available for legacy users). If not specified, GrantType defaults to client_credentials.
After you have obtained the access and refresh tokens, you can connect to data and refresh the OAuth access token either automatically or manually.
Automatic Refresh of the OAuth Access Token
To have the connector automatically refresh the OAuth access token, set the following on the first data connection.
- InitiateOAuth: REFRESH.
- APIKey: The Application key in your app settings.
- OAuthClientId: The OAuth Client Id in your app settings.
- OAuthClientSecret: The OAuth Secret in your app settings.
- OAuthAccessToken: The access token returned by GetOAuthAccessToken.
- OAuthRefreshToken: The refresh token returned by GetOAuthAccessToken.
Manual Refresh of the OAuth Access Token
The only value needed to manually refresh the OAuth access token when connecting to data is the OAuth refresh token. Use the RefreshOAuthAccessToken stored procedure to manually refresh the OAuthAccessToken after the ExpiresIn parameter value returned by GetOAuthAccessToken has elapsed, then set the following connection properties:
- APIKey: The Application key in your app settings.
- OAuthClientId: The OAuth Client Id in your app settings.
- OAuthClientSecret: The OAuth Secret in your app settings.
Then call RefreshOAuthAccessToken with OAuthRefreshToken set to the OAuth refresh token returned by GetOAuthAccessToken. After the new tokens have been retrieved, open a new connection by setting the OAuthAccessToken property to the value returned by RefreshOAuthAccessToken.
Finally, store the OAuth refresh token so that you can use it to manually refresh the OAuth access token after it has expired.
Next Step
See Using the Connector to create data visualizations.