Establishing a Connection
Configure a Connection Profile
From the CData ribbon, click Get Data and select From Slack connection/s to launch the CData Query window. To setup a new connection, you will have to click the New Slack Connection button. Here you can set the connection settings, test the connection, and save the connection profile.
Connecting to Slack
The add-in supports the following authentication mechanisms:
- OAuth (Slack's "V2" implementation of OAuth 2.0 and OAuth via OpenId Connect are supported)
- Token Authentication
Token Authentication
Use Token Authentication to authenticate to Slack with a non-expiring token. If you want the added security of tokens that expire and refresh, see the documentation for the "OAuth" authentication method in the next section.
To authenticate via Token Authentication, create an OAuth application and generate a non-expiring OAuth token, as described in Creating a Custom OAuth Application, then set the following connection properties:
- AuthScheme: Token
- Token: the OAuth token value you generated, found in your application's settings under Features > OAuth & Permissions > OAuth Tokens > User OAuth Token. Tokens that have enabled token rotation are not supported in this authentication method.
OAuth
Set AuthScheme to OAuth.
The following subsections describe how to authenticate to Slack via the available OAuth flows.
There are two supported OAuth authentication methods available. The setup process is the same for all OAuth methods (aside from the scopes set for custom apps), so configure the add-in in accordance with the type of app you're using to authenticate.
- Set OAuthVersion to v2 for Modern Slack apps.
- Set OAuthVersion to openid for Slack apps using "Sign in with Slack".
Desktop Applications
CData provides an embedded OAuth application that simplifies authentication at the desktop; that is, in situations where the user is using a local server not connected to the internet.
You can also authenticate from the desktop via a custom OAuth application, which you configure and register at the Slack console. For further information, see Creating a Custom OAuth Application.
Before you connect, set these properties:
- InitiateOAuth: GETANDREFRESH. Used to automatically get and refresh the OAuthAccessToken.
- Custom OAuth applications only:
- OAuthClientId: The client Id assigned when you registered your custom OAuth application.
- OAuthClientSecret: The client secret assigned when you registered your custom OAuth application.
- CallbackURL: The redirect URI defined when you registered your custom OAuth application.
When you connect, the add-in opens Slack's OAuth endpoint in your default browser. Log in and grant permissions to the application.
When the access token expires, the add-in refreshes it automatically.
Connection Properties
The Connection properties describe the various options that can be used to establish a connection.
Managing Connections
After successfully authenticating to Slack you will be able to customize the data you are importing. To learn more about this, see Managing Connections.
See Also
- Querying Data: Use the data selection wizard to pull data into a spreadsheet. You can also configure scheduled data refresh here.
- Using the Excel Add-In: Find other ways to interact with Slack data, such as using the available CData Excel Functions.