Skip to main content

Salesforce CRM

Salesforce app integration with client’s salesforce account can allow CM to fetch customer credentials, add or modify them too, which will allow organization to implement bidirectional data flow from user account to CM-Marketplace and back and forth allowing organization to act on behalf of users to provide rich integrated services.

Salesforce connected App​

Salesforce connected app is the OAuth configuration inside salesforce account that provides way for customer to integrate their accounts with our service to make bidirectional transfer work.

To create connected app, follow the instructions:

  1. Log in to your Salesforce Developer Account.
  2. Navigate to the App Manager.
  3. Click on the "New Connected App" button.
  4. Fill in the basic information:
    • Connected App Name: Enter a suitable name for your connected app.
    • API Name: Provide a unique API name for your connected app.
    • Contact Email: Enter your contact email address.
  5. Enable OAuth Settings:
    • Check the "Enable OAuth Settings" box.
  6. Configure the Callback URL:
    • In the "Callback URL" field, enter the URL where Salesforce will redirect the user after authentication. Example: https://www.yourapp.com/callback-url
  7. Add OAuth Scopes:
    • In the "Selected OAuth Scopes" section, add the required scopes for your application (e.g., openid, profile, email).
  8. Save the connected app.
  9. Obtain the Consumer Key and Consumer Secret:
    • After saving, note down the "Consumer Key" and "Consumer Secret" values from the connected app detail page.

Setup OAuth/App flow:​

  1. Implement the OAuth 2.0 authorization flow in your app:
    • Create a login button in your app's user interface, such as a web page or mobile app screen.
    • When the user clicks on the "Login with Salesforce" button, redirect them to the Salesforce OAuth authorization endpoint (https://login.salesforce.com/services/oauth2/authorize).
    • Include the following parameters in the redirect URL:
      • response_type=code (for authorization code flow)
      • client_id={your_consumer_key}
      • redirect_uri={your_callback_url}
      • scope={requested_scopes} (e.g., openid, profile, email)
  2. Handle the callback from Salesforce:
    • After the user logs in with their Salesforce credentials and grants the requested permissions, Salesforce will redirect them to your specified callback URL.
    • In your app, implement a callback endpoint or function to receive this redirect.
    • Extract the code parameter from the callback URL.
  3. Exchange the authorization code for an access token and user information:
    • Make a server-side request from your app to the Salesforce token endpoint (https://login.salesforce.com/services/oauth2/token).
    • Include the following parameters in the request payload:
      • grant_type=authorization_code
      • client_id={your_consumer_key}
      • client_secret={your_consumer_secret}
      • redirect_uri={your_callback_url}
      • code={the_code_from_callback}
    • Parse the response from Salesforce, which will include the access token, refresh token, and other details.
    • You can use the access token to make API calls on behalf of the user and retrieve their information.

After setting up oAuthFlow, to setup integration of CDP follow these instructions: Salesforce <-> CDP