Salesforce - How do I set up my partner credentials for OAuth?

Last updated: December 1, 2026

Overview

This guide shows you how to create an External Client App in Salesforce, let your customers authorize it, and enter its OAuth credentials in Merge. Your end users then connect Salesforce through your own OAuth app, and your app name shows on the Salesforce consent screen.

Your customers authorize the app from their own Salesforce orgs. In those orgs, Salesforce treats it as an uninstalled app and blocks new users from authorizing it. Each customer org needs one of these three options (see Step 5):

  • Option A: Connect as a System Administrator

  • Option B: The customer admin installs your app

  • Option C: Distribute a managed package (best at scale)

Prerequisites

  • A Salesforce org where you can create External Client Apps. A free Developer Edition org works.

Instructions

Step 1: Create an External Client App in Salesforce

  1. Log in to Salesforce. Click the Gear icon, then click Setup from the drop-down menu.

    Salesforce header with the Gear icon menu open and Setup highlighted
  2. Using the Quick Find search box, search for and select External Client App Manager.

    Setup Quick Find search showing External Client App Manager under External Client Apps
  3. Click New External Client App.

    External Client App Manager list with a New External Client App button and apps showing Packaged or Local type
  4. Enter a name for the app. The name must be unique within your organization, for example [Your Company Name] Merge.

  5. Enter a contact email address. Salesforce uses it to contact you about the app.

  6. Set Distribution State to Packaged. The default is Local, which limits the app to your org, so your customers cannot authorize it. You cannot change this field after you create the app.

    New External Client App page with the Distribution State drop-down open, showing Local and Packaged

Steps 1 and 2 use the same New External Client App page. Do not click Create until you finish Step 2.

Step 2: Enable OAuth settings

  1. In the API (Enable OAuth Settings) area of the page, select Enable OAuth.

  2. Set Callback URL to https://app.merge.dev/oauth/callback.

  3. Complete the following fields:

    • Check the Require Secret for Web Server Flow box.

    • Check the Require Secret for Refresh Token Flow box.

    • Leave the other settings in the Security section as they are. Salesforce pre-checks three more settings and grays them out, and you cannot change them.

    • Add the three scopes below to the Selected OAuth Scopes box.

      • Access unique user identifiers (openid)

      • Manage user data via APIs (api)

      • Perform requests at any time (refresh_token, offline_access)

      Salesforce does not have granular scopes. Permissions come from the authenticated user. Your app needs the scopes above to access the API.

      See Salesforce's OAuth scopes documentation.

    External Client App OAuth settings with the callback URL, selected OAuth scopes and Require Secret boxes
  4. Click Create. Salesforce can take 10 minutes or longer to provision a new app, so wait before you test the connection.

  5. Open the app in External Client App Manager. To find the manager, search for External Client App Manager in the Quick Find search box.

    External Client App Manager list with the app name highlighted
  1. Check your refresh token policy.

    1. Open the Policies tab and select OAuth Policies. Under App Authorization, find Refresh Token Policy. On a new app, the label is Refresh Token Policy (Idle Expiration Time Limit Enforced).

    2. Review the following settings, even if the section appears grayed out:

      1. Expire refresh token if not used for specific time

      2. Refresh Token Validity Period

      3. Refresh Token Validity Unit

    3. Select Refresh token is valid until revoked if it is available. If it is not available, select the longest option available. If these settings are grayed out, you cannot change them. Lifting the limit needs a Salesforce Support request.

      If your policy expires refresh tokens after a period of inactivity, users may need to relink their Salesforce connection when the refresh token expires.

      Inactivity means the refresh token has not been used during that period, not necessarily that the user has not signed in to Salesforce.

    App Authorization section showing the Refresh Token Policy and its idle expiration settings

Step 3: Get your Consumer Key and Secret

  1. Navigate to the Settings tab, expand the OAuth Settings menu, and select Consumer Key and Secret. It opens in a new browser tab.

    External Client App Settings tab with the Consumer Key and Secret button highlighted under OAuth Settings
  1. Copy the Consumer Key and the Consumer Secret. You enter them in Step 4.

    Consumer Details page showing the Consumer Key and Consumer Secret with Copy buttons, values redacted

Treat the Consumer Secret like a password. Anyone who has it can request tokens as your app.

Step 4: Add your Salesforce client credentials to Merge

  1. Navigate to the Integrations page in the Merge dashboard and locate the Salesforce integration.

    Merge dashboard Integrations page with the Salesforce integration
  2. For each parameter, click Edit and enter the corresponding values:

    • OAuth Client Id: The Consumer Key from your External Client App.

    • OAuth Client Secret: The Consumer Secret from your External Client App.

    • OAuth Redirect URI: https://app.merge.dev/oauth/callback

    Merge credential form for the Salesforce OAuth client values

Step 5: Let your customers authorize your app

Salesforce blocks users from authorizing an app that is not installed in their org. Choose the option that fits how you distribute your app.

Option A: Connect as a System Administrator

Users whose profile includes the Approve Uninstalled Connected Apps permission can authorize your app without installing it. Salesforce gives this permission to the standard System Administrator profile by default. If a Salesforce admin on that profile connects, the flow works.

Custom admin profiles do not get this permission, including profiles cloned from System Administrator. Add Approve Uninstalled Connected Apps to the profile or to a permission set, or use Option B.

Option B: The customer admin installs your app

Use this option for one-time or low-volume onboarding. The customer admin installs your app from their org OAuth usage list.

  1. Ask a user in the customer org to try to connect once, so your app shows in the org OAuth usage list.

  2. In Setup, enter OAuth Usage in the Quick Find search box.

  3. Open External Client Apps > OAuth Usage.

  4. Find your app in the list. In the Actions column, click Install, then confirm.

  5. Check that Permitted Users is set to All users can self-authorize, so other users in the org can connect without individual approval. For an External Client App, this setting is under Policies > OAuth Policies > Plugin Policies. It is the default for a new app.

External Client Apps > OAuth Usage and Connected Apps > Connected Apps OAuth Usage are two separate pages. A new External Client App shows only on the first page.

Option C: Distribute a managed package (best at scale)

Use this option to distribute your app to many customer orgs. Customers install your managed package from an install link.

  1. Make sure Distribution State is Packaged. Only packaged apps can be added to a managed package.

  2. Create a managed package that contains your app. Salesforce recommends second-generation managed packages. See Salesforce documentation on packaging External Client Apps.

  3. To set the default policies that ship with the app, use the Package Default tab. Values you set on the Settings tab do not change the packaged policies.

  4. Promote the package version to the released state. A beta version installs only in scratch orgs and sandboxes.

  5. Send your customers the install link for the released package version. It has this format: https://login.salesforce.com/packaging/installPackage.apexp?p0=<04t package version ID>

  6. Your customer's admin opens the link and installs the package. After that, all users in their org can authorize your app.

You cannot reverse the promotion of a package version.

Do not delete the app from the org where you created it. Your customers' orgs depend on its OAuth settings, and their authorization stops working if you delete it.

Notes

The three gates

A customer can connect only after your app clears three gates. Most setup failures come from one of them.

Gate

Requirement

Error if you miss it

1. Distributable

The app's Distribution State is Packaged, not Local

OAUTH_AUTHORIZATION_BLOCKED: "Cross-org OAuth flows are not supported for this external client app"

2. Authorizable

The app is installed in the user's org, or the user has the Approve Uninstalled Connected Apps permission

OAUTH_APPROVAL_ERROR_GENERIC: "We can't authorize you because of an OAuth error"

3. Registered

The Consumer Key and Secret are added in Merge, and the callback URL matches exactly

No error at Salesforce. The flow completes, then fails on the redirect back

The gates are sequential. Fixing Gate 1 shows Gate 2. Your first customer attempt can still be blocked after you set Distribution State to Packaged. That blocked attempt makes your app show in the customer's OAuth usage list, so their admin can install it.

Troubleshooting

What your user sees

What it means

Fix

OAUTH_AUTHORIZATION_BLOCKED: "Cross-org OAuth flows are not supported for this external client app"

Gate 1. The app's Distribution State is Local

Create a new app with Distribution State set to Packaged (Step 1). You cannot edit this field after you create the app

"We can't authorize you because of an OAuth error", OAUTH_APPROVAL_ERROR_GENERIC, or app must be installed into org in the URL

Gate 2. The app is not installed in the user's org, and the user does not have the Approve Uninstalled Connected Apps permission

Have the customer admin install the app (Step 5, Option B or Option C), or connect as a standard-profile admin (Step 5, Option A)

The flow still fails after you set Distribution State to Packaged

Expected. Packaged clears Gate 1 and shows Gate 2

Complete Step 5. The first blocked attempt makes your app show in the customer's OAuth usage list

The admin cannot find your app in Connected Apps OAuth Usage

External Client Apps have their own OAuth usage page

Send the admin to External Client Apps > OAuth Usage (Step 5, Option B)

OAUTH_APP_BLOCKED or "this app is blocked by admin"

The org has API Access Control turned on, and your app is blocked or not allowed

The customer admin approves the app under OAuth usage, or in their API Access Control settings

The flow redirects to an unexpected page and fails at the end

The callback URL in Salesforce does not match the one Merge sends

Make sure the app's Callback URL list contains exactly https://app.merge.dev/oauth/callback

A new app fails right after you create it

Salesforce has not finished provisioning the app

Wait at least 10 minutes, then try again

A connection that was idle stops working

New External Client Apps can limit idle refresh tokens

Ask the user to authorize again. If the limit is grayed out, lifting it needs a Salesforce Support request

Existing users lose access

Salesforce's block on uninstalled apps does not affect earlier authorizations, so this is unexpected unless the token was revoked

Ask the user to authorize again. Their admin might need to complete Step 5 first

Production and sandbox

Salesforce separates environments by login URL. Production uses login.salesforce.com, and sandbox uses test.salesforce.com.