Salesforce Authentication using OAuth
  • 15 Nov 2022
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

Salesforce Authentication using OAuth

  • Dark
    Light

The Salesforce platform implements the OAuth 2.0 Authorization Framework, so users can authorize applications to access Force.com resources. When you configure AutoRABIT and Salesforce source, you must know the Client_ID and Client_Secret token values for the Salesforce organization that you want to index.

Important Point to Consider:
  • The following article is
    • applicable for: self-hosted and dedicated hosted users
    • not applicable for: shared cloud users
  • For share cloud customers, AutoRABIT does have a pre-configured connected app via salesforce and therefore client_id  and client_secret fields are not exposed in the user interface. For more information, please refer to the link: Adding a Salesforce Org connection via OAuth

To get the Salesforce Client_ID and Client_Secret values

  1. Log in to Salesforce as an administrator. 
  2. In the drop-down list of the account (in the upper-right corner), select Setup
  3. In the navigation menu on the left, under App Setup, expand Create, and then click Apps.
  4. On the Connected Apps page, click the New button.
  5. On the New Connected App page, fill the following required fields under Basic Information:
    • Enter meaningful names in the Connected App Name and API Name boxes.
    • Enter your email in the Contact Email box so that you can receive messages from this application.
  6. Go to API (Enable OAuth Settings), and select Enable OAuth Settings
    • In the Callback URL field, enter https://<AutoRABIT access URL>/oauth/_callback
      For example https://preview.autorabit.com/oauth/_callback
      Depending on which OAuth flow you use, this is typically the URL that a user’s browser is redirected to after successful authentication.
    • In the Available OAuth Scopes list, select the following items:
      • Access and manage your data (API)
      • Full access (full)
      • Perform requests on your behalf at any time (refresh_token, offline_access)
      • and click Add for each so that they appear in the Selected OAuth Scopes list.
  7. Click the Save button to save the new Connected App.
  8. In the Connected Apps list, find the App that you just created, and then click Manage
    1. On the page that opens, click the Edit button. 
    2. Under OAuth policies, select All users may self-authorize in the Permitted Users list, and then click the Save button. 
  9. Go back to the Connected Apps list, and click the App that you just created. 
  10. In the page that appears for your new connected app, in the API (Enable OAuth Settings) section:
    1. Copy the Consumer Key value and paste it into a secure reference document of your choice. The Consumer Key is the client_id.
    2. Next to Consumer secret, click Click to reveal, copy the value that appears, and then paste it in your secure reference document. The Consumer secret is the client_secret.
  11. Open the oauth.properties file in the .rabit/org/oauth.properties directory and update the client_id and client_secret token during on-premise installation.
    clientId=<Consumer Key>
    clientSecret=<Consumer Secret>
    redirecturl=<AutoRABIT application access URL>/oauth/_callback
    hosturl==<AutoRABIT application access URL>

Was this article helpful?