Configuring the driver to use OAuth 2.0
- Last Updated: July 30, 2025
- 2 minute read
- DataDirect Connectors
- ODBC
- Salesforce 8.0
- Documentation
Prerequisites:
- Client application registered as a Salesforce Connected App.
- The client ID and client secret (Consumer Key and Consumer Secret)
- An access token or refresh token
After you have registered your client application as a Salesforce Connected App and obtained the required OAuth information, you may configure the driver to access Salesforce resources using OAuth 2.0.
To configure the driver, set the following connection options:
- Set the Authentication Method option to
oauth2.0. - Set the Schema Map option to specify either the name or the absolute path and name of the configuration file where the map of the Salesforce data model is written. Note that a value for the Schema Map option must be specified every time you authenticate to a Salesforce instance using OAuth 2.0.
- Set the Client ID option to specify the consumer key for your application. See Registering your application with Salesforce or Obtaining the client ID, client secret, and scopes.
- Set either of the following options:
- Set the Access Token option to specify the access token you have obtained from Salesforce. Generally, an access token is available for a short period of time and may only be used for a single session.
- Set the Refresh Token option to specify the refresh token you have obtained from Salesforce. With a valid refresh token, the driver can obtain a new access token. In this way, a refresh token enables application access to Salesforce for multiple sessions over an extended period of time, as dictated by your organization's policies.
If a value for the Access Token option is not specified, the driver uses the value of the Refresh Token option to make a connection. If both values are not specified, the driver cannot make a successful connection. If both are specified, the driver ignores the Access Token value and uses the Refresh Token value to generate a new Access Token value.
See Obtaining access and refresh tokens with Postman for details on how to obtain access or refresh tokens using Postman.
- Optionally, set the Client Secret option to specify the consumer secret for your application. See Registering your application with Salesforce or Obtaining the client ID, client secret, and scopes.
The following examples show how to connect to a Salesforce instance using OAuth2.0 authentication.
Using a connection string:
DRIVER=DataDirect 8.0 Salesforce;AuthenticationMethod=oauth2.0;
SchemaMap=ABC;clientId=RaARBTsXZTeN4Qx67qPLOS;RefreshToken=YaTARBsRZLeM4Px47qSOLP;
AccessToken=ZbTARBsRZLeM4Px56qOLPS
Using the odbc.ini file:
Driver=ODBCHOME/lib/xxsfrc28.yy
AuthenticationMethod=oauth2.0
SchemaMap=ABC
ClientId=RaARBTsXZTeN4Qx67qPLOS
RefreshToken=YaTARBsRZLeM4Px47qSOLP
AccessToken=ZbTARBsRZLeM4Px56qOLPS