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
Log in to Salesforce. Click the Gear icon, then click Setup from the drop-down menu.

Using the Quick Find search box, search for and select External Client App Manager.

Click New External Client App.

Enter a name for the app. The name must be unique within your organization, for example [Your Company Name] Merge.
Enter a contact email address. Salesforce uses it to contact you about the app.
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.
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
In the API (Enable OAuth Settings) area of the page, select Enable OAuth.
Set Callback URL to
https://app.merge.dev/oauth/callback.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.

Click Create. Salesforce can take 10 minutes or longer to provision a new app, so wait before you test the connection.
Open the app in External Client App Manager. To find the manager, search for External Client App Manager in the Quick Find search box.

Check your refresh token policy.
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).
Review the following settings, even if the section appears grayed out:
Expire refresh token if not used for specific time
Refresh Token Validity Period
Refresh Token Validity Unit
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.

Step 3: Get your Consumer Key and Secret
Navigate to the Settings tab, expand the OAuth Settings menu, and select Consumer Key and Secret. It opens in a new browser tab.

Copy the Consumer Key and the Consumer Secret. You enter them in Step 4.

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
Navigate to the Integrations page in the Merge dashboard and locate the Salesforce integration.

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

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.
Ask a user in the customer org to try to connect once, so your app shows in the org OAuth usage list.
In Setup, enter OAuth Usage in the Quick Find search box.
Open External Client Apps > OAuth Usage.
Find your app in the list. In the Actions column, click Install, then confirm.
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.
Make sure Distribution State is Packaged. Only packaged apps can be added to a managed package.
Create a managed package that contains your app. Salesforce recommends second-generation managed packages. See Salesforce documentation on packaging External Client Apps.
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.
Promote the package version to the released state. A beta version installs only in scratch orgs and sandboxes.
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>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 |
|
2. Authorizable | The app is installed in the user's org, or the user has the Approve Uninstalled Connected Apps permission |
|
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 |
|---|---|---|
| Gate 1. The app's Distribution State is | Create a new app with Distribution State set to |
"We can't authorize you because of an OAuth error", | 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 | Expected. | 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) |
| 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 |
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.