Establishing a Connection
Configure a Connection Profile
From the CData ribbon, click Get Data and select From Okta connection/s to launch the CData Query window. To setup a new connection, you will have to click the New Okta Connection button. Here you can set the connection settings, test the connection, and save the connection profile.
Connecting to Okta
To connect to Okta, set this parameter:
- Domain: Your Okta domain.
Authenticating to Okta
Okta supports OAuth authentication only. To enable this authentication from all OAuth flows, you must create a custom OAuth application.The following subsections describe how to authenticate to Okta from three common authentication flows.
For information about how to create a custom OAuth application, see Creating a Custom OAuth Application.
For a complete list of connection string properties available in Okta, see Connection.
Desktop Applications
To connect via a desktop application, you must set and refresh the OAuth acess token.Get and Refresh the OAuth Access Token
After setting the following, you are ready to connect:
- OAuthClientId: The Key displayed when you created your custom OAuth application.
- OAuthClientSecret: The Secret displayed when you created your custom OAuth application.
- CallbackURL: The Callback URL defined when you registered your application. This is typically set to http://localhost:33333.
When you connect, the add-in opens Okta'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.
Automatic Refresh of the OAuth Access Token
To have the add-in automatically refresh the OAuth access token:
- Before connecting to data for the first time, set these connection parameters:
- InitiateOAuth: REFRESH.
- OAuthClientId: The Key displayed when you created your custom OAuth application.
- OAuthClientSecret: The Secret displayed when you created your custom OAuth application.
- OAuthAccessToken: The access token returned by GetOAuthAccessToken.
- OAuthSettingsLocation: The path where you want the add-in to save the OAuth values, which persist across connections.
- On subsequent data connections, set:
- InitiateOAuth
- OAuthSettingsLocation
Manual refresh of the OAuth access token:
The only value needed to manually refresh the OAuth access token is the OAuth refresh token.
- To manually refresh the OAuthAccessToken after the ExpiresIn period (returned by GetOAuthAccessToken) has elapsed, call the RefreshOAuthAccessToken stored procedure.
- Set these connection properties:
- OAuthClientId: The Client Id in your custom OAuth application settings.
- OAuthClientSecret: The Client Secret in your custom OAuth application settings.
- Call RefreshOAuthAccessToken with OAuthRefreshToken set to the OAuth refresh token returned by GetOAuthAccessToken.
- After the new tokens have been retrieved, set the OAuthAccessToken property to the value returned by RefreshOAuthAccessToken. This opens a new connection.
Store the OAuth refresh token so that you can use it to manually refresh the OAuth access token after it has expired.
Connection Properties
The Connection properties describe the various options that can be used to establish a connection.
Managing Connections
After successfully authenticating to Okta 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 Okta data, such as using the available CData Excel Functions.