Why External Client Apps only
This guide uses External Client Apps (ECA) only. Salesforce is phasing out Connected Apps: in Winter ‘26, creating connected apps in the UI was turned off by default on new orgs (customers had to enable “Allow creation of connected apps” to keep doing it). Starting in Spring ‘26, that option can no longer be turned on unless Salesforce Support approves it. Distribution options:- Local: For use only inside your own Salesforce org.
- Packaged: For distributing your app to other Salesforce orgs (requires packaging and installation).
Prerequisites for External Client Apps
- External Client Apps are available in Professional, Performance, Unlimited, and Developer editions.
- Your user must have the Create, Edit, and Delete External Client Apps permission.
Creating an External Client App for internal use (Local distribution)
Use this option if your app will only be used within your own Salesforce organization.Create an External Client App
- Log in to your Salesforce account.
- Click on the Setup menu, in the Quick Find box, enter App Manager, and then select App Manager.
- Click New External Client App.
Configure External Client App settings
- Fill in the required Basic information:
- External Client App Name: The display name of your app as it will appear in Salesforce.
- API Name: Auto-filled based on the app name; used internally by Salesforce.
- Contact Email: The email address Salesforce can use to contact the app owner.
- Distribution State: Select Local for internal use within your Salesforce organization.
- Contact Phone (Optional): A phone number for reaching the app’s designated point of contact.
- Info URL (Optional): A link to your app’s website or documentation.
- Logo Image URL (Optional): A direct URL to an image that will be used as the app’s logo.
- Icon URL (Optional): A direct URL to a smaller icon representing the app.
- Description (Optional): A short summary describing what the app does.
- Check the API (Enable Oauth Settings) checkbox.
- For Callback URL, enter:
https://api.nango.dev/oauth/callback. - Under Selected OAuth Scopes, add the permissions your app needs. At minimum, add:
- “Access and manage your data (api)”
- “Perform requests on your behalf at any time (refresh_token, offline_access)”
- Under Flow Enablement, check Enable Authorization Code and Credentials Flow.
- Under Security, leave the default options selected:
- ✅ Require secret for Web Server Flow
- ✅ Require secret for Refresh Token Flow
- ✅ Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows
- Click Create.
Obtain API credentials
- After saving, navigate to your app Settings tab.
- Scroll down to Oauth Settings section.
- Click Consumer Key and Secret to view your credentials. You may be required to verify your identity.
- Copy the Consumer Key (this is your Client ID) and Consumer Secret (this is your Client Secret).
- You will need these credentials when configuring your integration in Nango.
Creating an External Client App for external distribution (Packaged distribution)
Use this option if your app will be distributed to other Salesforce organizations. This requires a more complex setup with packaging.Environment setup requirements
Important: Due to Salesforce limitations, you need two separate Salesforce accounts:- Developer Hub (Dev Hub) account: For creating and managing packages.
- Namespace account: Used to register and manage a unique namespace for packaging and publishing apps.
Set up two Salesforce accounts
- Create Developer Hub Account:
- Go to Salesforce Developer Edition signup and create your first account
- Enable Dev Hub: Setup → Dev Hub → Enable Dev Hub
Please note that this change is irreversible
- Create Namespace Account:
- Create a second Salesforce Developer Edition account
- Register a namespace: Setup → Package Manager → Register Namespace
- Choose a unique namespace (this will be part of your package identity)
- Link the namespace to your Dev Hub account:
- Log in to your Dev Hub organization as the System Administrator or as a user with the Salesforce DX Namespace Registry permissions.
- From the App Launcher menu, select Namespace Registries
- Click Link Namespace
- In the pop-up window that appears, log in to your Namespace Account (the Developer Edition organization where your namespace is registered) using the System Administrator’s credentials.
- After successful linking, you can view all linked namespaces by selecting the All Namespace Registries list view.
You can’t link organizations without a namespace - sandboxes, scratch organizations, patch organizations, and branch organizations require a namespace to be linked to the Namespace Registry.
Create External Client App in Developer Hub (Dev Hub)
- Log in to your Developer Hub (Dev Hub) (the first account).
- Click on Setup → App Manager → New External Client App.
- Configure the app settings:
- External Client App Name: The display name of your app as it will appear in Salesforce.
- API Name: Auto-filled based on the app name; used internally by Salesforce.
- Contact Email: The email address Salesforce can use to contact the app owner.
- Distribution State: Select Packaged.
- Contact Phone (Optional): A phone number for reaching the app’s designated point of contact.
- Info URL (Optional): A link to your app’s website or documentation.
- Logo Image URL (Optional): A direct URL to an image that will be used as the app’s logo.
- Icon URL (Optional): A direct URL to a smaller icon representing the app.
- Description (Optional): A short summary describing what the app does.
- Enable OAuth settings:
- Check API (Enable Oauth Settings)
- Callback URL:
https://api.nango.dev/oauth/callback - Selected OAuth Scopes: Add required scopes (minimum: “api”, “refresh_token, offline_access”)
- Flow Enablement: Enable Authorization Code and Credentials Flow
- Under Security, leave the default options selected:
- ✅ Require secret for Web Server Flow
- ✅ Require secret for Refresh Token Flow
- ✅ Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows
- Click Create.
- After saving, navigate to your app Settings tab.
- Scroll down to Oauth Settings section.
- Click Consumer Key and Secret to view your credentials. You may be required to verify your identity.
- Copy the Consumer Key (this is your Client ID) and Consumer Secret (this is your Client Secret). You will need these credentials when configuring your integration in Nango.
Configure token settings (recommended)
- Click your app’s Policies tab, then click the Edit button. Scroll down to OAuth Policies, and under App Authorization, set the Refresh Token Policy to “Refresh token is valid until revoked” for long-lived access.
- Click Save.
Install and set up Salesforce CLI
-
Install Salesforce CLI:
- Mac:
brew install salesforce-clior download from Salesforce CLI releases - Windows: Download the installer from Salesforce CLI releases
- Linux: Use npm:
npm install -g @salesforce/clior download from Salesforce CLI releases
- Mac:
-
Verify installation:
-
Login to your Developer Hub account:
This will open a browser window where you can log in to your Developer Hub account (the first account you created).
-
Verify login and see connected organizations:
You should see your Dev Hub organization listed with a “(D)” indicating it’s set as the default Dev Hub.
-
Create a Salesforce project:
This creates a new Salesforce project directory structure that we’ll use for packaging.
- Create a package:
my-dev-hub) in place of MyOrgAlias if different.-
Open the project in your IDE:
Open the
nangoproject folder in your preferred IDE (e.g., VS Code): -
Create package.xml file:
In the project root directory, create a
package.xmlfile with the following configuration:This package.xml defines the metadata types we’ll be working with for External Client Apps and their OAuth settings. -
Retrieve the External Client App from Dev Hub:
Now retrieve the External Client App you created in the Dev Hub account using the following command:
Replace
johndoe@example.comwith the username of your authenticated Dev Hub account. This command retrieves the External Client App metadata and OAuth settings into your local project. This will add 2 folders (externalClientApps and extlClntAppOauthSettings) in yourforce-app/main/default/folder of the project you are working on. If you enabled ExtlClntAppOauthConfigurablePolicies in the XML, you will get 3 folders instead, with the third being extlClntAppOauthConfigurablePolicies.If you have more external client apps registered, they will also be added. You can remove them by deleting the specific files inside those folders to remain with the packaged one we created earlier. - Configure sfdx-project.json and create package version: First, get the package ID by running:
sfdx-project.json file in the root of your project and configure it like this:<PACKAGE_ID> with the ID obtained from the previous command and <YOUR_NAMESPACE> with the namespace you linked to your Dev Hub account.Then create a package version:--installation-key "" empty to make the package installation open, or provide a key that users will need to enter during installation.After successfully creating the package, you will get a successful message with an installation URL that you can use to distribute your External Client App to other Salesforce organizations.- Install the package to target organization: Use the installation URL above to install your package to the target Salesforce organization where you want to use the External Client App.
Already using a Connected App? Migrate to External Client App
If you previously created a Connected App, you can migrate it to an External Client App that Salesforce recommends.- From Setup, go to App Manager and open the connected app.
- If eligible, click the Migrate to External Client App button.
- Confirm that the app is local and doesn’t use the username-password flow.
- Click Migrate.
- A new External Client App will be created; the old Connected App will remain in read-only mode.
All changes must be made in the new External Client App. Deleting the External Client App reactivates the original Connected App with its previous settings intact.
Connection configuration in Nango
Salesforce uses a different API base URL, theinstance_url, for each customer. Nango automatically retrieves the instance_url from Salesforce and stores it in the connection config. If you use the Nango Proxy, it uses the correct API base URL automatically. You can also retrieve the instance_url via the backend SDK or Connections API.
Important considerations
Troubleshooting invalid Client ID errors
If you seeinvalid_client_id, ensure your (developer) user password does not contain special characters.