Advanced Settings
Salesforce Chatter uses OAuth 2.0 authentication. To authenticate to Salesforce Chatter via OAuth 2.0, you will need to obtain the OAuthClientId, OAuthClientSecret, and CallbackURL by registering an app with Salesforce Chatter.
Connecting to SalesforceChatter
Salesforce Chatter uses OAuth 2.0 authentication. OAuth requires the authenticating user to interact with Salesforce Chatter using the browser. The provider facilitates this in various ways as described below.
Create a Connected App
You can follow the procedure below to register an app and obtain the OAuth client credentials, the OAuthClientId and OAuthClientSecret:
- Log into Salesforce.com.
- 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.
- Enter a name to be displayed to users when they log in to grant permissions to your app, along with a contact email address.
-
Click Enable OAuth Settings and enter a value in the Callback URL box.
If you are making a desktop application, set the Callback URL to https://localhost:33333 or a different port number of your choice.
If you are making a Web application, set the Callback URL to a page on your Web app you would like the user to be returned to after they have authorized your application. Note that you must redirect the user to an HTTPS URL.
- Select the scope of permissions that your app will request from the user, including Chatter.
- Once you have created the app, click your app name to open a page with information about your app. The OAuth client credentials, the consumer key and consumer secret, are displayed.
Authenticate to Salesforce Chatter from a Desktop Application:
After setting the following connection properties, you are ready to connect:
- OAuthClientId: Set this to the Consumer Key in your app settings.
- OAuthClientSecret: Set this to the Consumer Secret in your app settings.
- CallbackURL: Set this to the Callback URL in your app settings, https://localhost:portNumber.
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken connection property.
- Extracts the access token from the callback URL and authenticates requests.
- Refreshes the access token when it expires.
- Saves OAuth values in OAuthSettingsLocation to be persisted across connections.
Authenticate to Salesforce Chatter from a Web Application:
You can call stored procedures to authenticate from a Web application or if the provider is not authorized to open a browser window. To authenticate, set the following connection properties:
- OAuthClientId: Set this to the Consumer Key in your app settings.
- OAuthClientSecret: Set this to the Consumer Secret in your app settings.
- CallbackURL: Set this to the Callback URL in your app settings.
In this OAuth flow, you exchange a verifier code for the OAuthAccessToken:
- Call GetOAuthAuthorizationURL. The stored procedure returns the URL to the OAuth endpoint.
- Log in and authorize the application. You are redirected back to the callback URL. The callback URL contains the verifier code in the query string parameter named "code".
- Extract the verifier code and call GetOAuthAccessToken.
Customizing the SSL Configuration
By default, the provider attempts to negotiate SSL/TLS by checking the server's certificate against the system's trusted certificate store. To specify another certificate, see the SSLServerCert property for the available formats to do so.
Connecting Through a Firewall or Proxy
HTTP Proxies
To connect through the Windows system proxy, you do not need to set any additional connection properties. To connect to other proxies, set ProxyAutoDetect to false.
In addition, to authenticate to an HTTP proxy, set ProxyAuthScheme, ProxyUser, and ProxyPassword, in addition to ProxyServer and ProxyPort.
Other Proxies
Set the following properties:
- To use a proxy-based firewall, set FirewallType, FirewallServer, and FirewallPort.
- To tunnel the connection, set FirewallType to TUNNEL.
- To authenticate, specify FirewallUser and FirewallPassword.
- To authenticate to a SOCKS proxy, additionally set FirewallType to SOCKS5.
Troubleshooting the Connection
To show provider activity from query execution to network traffic, use Logfile and Verbosity. The examples of common connection errors below show how to use these properties to get more context. Contact the support team for help tracing the source of an error or circumventing a performance issue.
- Authentication errors: Typically, recording a Logfile at Verbosity 4 is necessary to get full details on an authentication error.
- Queries time out: A server that takes too long to respond will exceed the provider's client-side timeout. Often, setting the Timeout property to a higher value will avoid a connection error. Another option is to disable the timeout by setting the property to 0. Setting Verbosity to 2 will show where the time is being spent.
- The certificate presented by the server cannot be validated: This error indicates that the provider cannot validate the server's certificate through the chain of trust. If you are using a self-signed certificate, there is only one certificate in the chain.
To resolve this error, you must verify yourself that the certificate can be trusted and specify to the provider that you trust the certificate. One way you can specify that you trust a certificate is to add the certificate to the trusted system store; another is to set SSLServerCert.