Set up a Developer Sandbox in Salesforce

Sign up for a developer account

  1. Sign up for a free Salesforce developer account by visiting the Sign up for your Salesforce Developer Edition page.

  2. After successfully creating your account, you will receive an email with instructions to access your sandbox environment.

Create an External Id field for the Account Object

  1. Log in to Salesforce. Ensure you are using the Lightning Experience UI.

  2. Click the menu icon in the upper right corner and select Setup.

    ../_images/21.png
  3. Click the Object Manager tab and select the Account object.

    ../_images/32.png
  4. Select Fields & Relationships from the sidebar menu.

  5. Click the New button.

    ../_images/41.png
  6. Select Text as the data type and click Next.

    ../_images/51.png
  7. Configure field metadata as follows:

    Field Label:   customExtIdField
    Length:        20
    Field Name:    customExtIdField
    External ID:   selected
    ../_images/61.png
  8. Complete the setup with default settings and save the field.

  9. Use the Search function to confirm the new field is present.

    ../_images/71.png

Create a OAuth Connected App

Warning

The configuration outlined here is intended solely for tutorial purposes.

Please consult with your security team to determine the appropriate configuration for your live or production environments.

  1. Go to the Home tab on the Setup page and search for App Manager.

    ../_images/81.png
  2. Click New Connected App

    ../_images/9.png
  3. Enter the following information:

    Connected App Name: Learn SW
    API Name: Learn SW
    Contact Email: <your email address>
    Enable Oauth Settings: checked
    Callback URL: https://login.salesforce.com/services/oauth2/success
    Selected OAuth Scopes: id, api and refresh_token
    ../_images/10.png
  4. Configure additional oAuth settings as follows:

    ../_images/11.png
  5. Save the application and Click Manage Consumer Details.

    ../_images/12.png
  6. Please make a note of the values for Consumer Key and Consumer Secret for future reference.

  7. Return to the previous page, and click Manage.

    ../_images/13.png
  8. Click Edit Policies.

  9. Update the following settings as needed:

    ../_images/15.png
  10. Save the settings and return to the previous page.

  11. Click Manage Profiles and select System Administrator from the list:

    ../_images/16.png
  12. Save the settings to finalize the Connected App setup.

Generate a Refresh Token

  1. Open a new browser tab and navigate to the following URL:

    https://<Org Domain>.my.salesforce.com/services/oauth2/authorize?client_id=<Consumer Key>&redirect_uri=https://login.salesforce.com/services/oauth2/success&response_type=code
    

    Replace <Org Domain> with your Salesforce organization domain (e.g., snoweaver-dev-ed.develope) and <Consumer Key> with the key obtained in the previous step.

  2. You may need to log in again. After logging in, the browser may display a blank page.

  3. Examine the URL of the blank page and locate the code parameter. Note its value, which will be URL-encoded and end with %3D%3D (the HTML-encoded representation of ==).

    ../_images/17.png
  4. Open a Command Line Terminal (such as LinuxShell or PowerShell).

  5. Execute the following curl command in the terminal, ensuring you replace the URL-encoded == (%3D%3D) with the actual == in the authorization code:

    curl -X POST -H "Content-type: application/x-www-form-urlencoded" \
    -d "grant_type=authorization_code" \
    -d "code=<Authorization Code>" \
    -d "client_id=<Consumer Key>" \
    -d "client_secret=<Consumer Secret>" \
    -d "redirect_uri=https://login.salesforce.com/services/oauth2/success" \
    https://<Org Domain>.my.salesforce.com/services/oauth2/token
    

    If you using a shell with jq installed, append | jq . to the command for improved formatting of the JSON response.

  6. The response should be a JSON document containing the refresh token, which you’ll use to configure the OAuth integration in Snowflake.

    ../_images/18.png