Set Up an External Client App for Data Custom Code SDK (Beta)

Set up an external client app to enable the SDK to authenticate with your sandbox. With this setup, you can develop and deploy custom scripts for batch data transform jobs from your local development environment.

Code extension is a pilot or beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Beta Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer's sole discretion.

Edition Table
Available in: Developer, Enterprise, Performance, and Unlimited Editions. See Data 360 edition availability.
User Permissions Needed
To set up an external client app in Data 360:Permission set:
  • Data Cloud Architect
  1. Create an external client app. See Create an External Client App.

  2. Under API (Enable OAuth Settings), select Enable OAuth Settings.

  3. Enter a callback URL. For example, http://localhost:5555/callback.

  4. Under OAuth Scopes, select these scopes.

  • Manage Data Cloud profile data (cdp_profile_api)
  • Manage user data via APIs (api)
  • Perform ANSI SQL queries on Data Cloud data (cdp_query_api)
  • Perform requests at any time (refresh_token, offline_access)
  1. Under Flow Enablement, select Enable Authorization Code and Credentials Flow and Require user credentials in the POST body for Authorization Code and Credentials Flow.

  2. Under Security, deselect Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows.

  3. Click Create.

  4. On your newly created External Client App page, click Policies > OAuth Policies, and then click Edit

  5. Under the App Authorization section, do the following:

    • Select an appropriate Refresh Token Policy based on your expected usage and preference.
    • Set IP Relaxation to Relax IP restrictions unless otherwise needed.
    • Click Save.
  6. Click the Settings tab and then under OAuth Settings, click Consumer Key and Secret. Copy the Consumer Key and Consumer Secret values to use when configuring credentials with the SDK.

  1. Note down these details of the external client app if you haven't already.

    • Consumer Key
    • Consumer Secret
    • Callback URL
    • Data 360 Sandbox login URL
  2. Initiate authorization and retrieve the Salesforce authorization code.

    1. Navigate to this URL in your web browser.
    1. In the Salesforce login page, log in using your credentials. After successful login, a consent screen appears.

    2. Click Allow. You are redirected to the web page of the redirect URL specified in your request.

    3. Copy the Salesforce OAuth code displayed on the web page to use it in the next step.

  3. Exchange the OAuth code obtained in the previous step for the Salesforce access token.

    The response will be a JSON object containing:

    You need these values to set up the SDK.

    FieldDescription
    access_tokenThe access token (also called core token)
    refresh_tokenThe refresh token for obtaining new access tokens
    instance_urlYour Salesforce instance URL