Sub topic 12
External Client Apps and Why They Replace Connected Apps
This chapter assumes you know basic Salesforce administration (users, profiles, permission sets, Setup), can read an HTTP request, and understand the difference between authentication and authorization. You should also have read the earlier chapters on connected app OAuth settings, scopes, flows, and policies. Here you will learn what an external client app (ECA) is, what problem it solves, and where it differs from a connected app.
What an external client app is
An external client app is a Salesforce configuration record that lets external software sign in and call Salesforce APIs through OAuth 2.0. It does the same job as a connected app. Both hold a consumer key, OAuth scopes, a callback URL, and rules about who may use the app.
The difference is in how the configuration is organized. A connected app keeps everything in one record. An ECA splits that record into two parts:
- Settings describe the app itself. They include its name, contact email, callback URLs, scopes, flow enablement, and the consumer key and secret. A developer usually owns these.
- Policies describe how a particular org lets the app behave. They include permitted users, IP relaxation, refresh token behavior, and session timeouts. An admin of the org that uses the app owns these.
The next chapter covers each part in detail. For now, remember that the split is the main design change.
Why Salesforce introduced ECAs
Connected apps mix developer concerns and admin concerns in one place. That causes several problems.
- Packaging is awkward. When you package a connected app, the admin policies travel with the developer settings. A subscriber org can end up with defaults that the publisher chose. The subscriber then edits the same record the publisher ships, which complicates upgrades.
- Secrets are easy to expose. A connected app's consumer secret is readable by anyone with enough access to the record. An ECA separates who can see developer settings from who can set policies.
- Defaults are permissive. Older connected apps often allow users to self-authorize. ECAs are designed so that access is denied until an admin acts.
- Deployment is inconsistent. Connected app metadata mixes values that differ per org (such as policies) with values that should not. This makes source-driven deployment error-prone.
Salesforce recommends ECAs for new integrations. Connected app creation is restricted by default in new orgs, so you may find you cannot create one unless an admin enables it. Existing connected apps keep working. Plan to migrate them over time, as a later chapter explains.
Side-by-side comparison
| Area | Connected app | External client app |
|---|---|---|
| Configuration | One record holds settings and policies | Settings and policies are separate |
| Who edits what | Mixed in the same record | Developer edits settings, admin edits policies |
| Packaging | Policies ship with the app | Policies are set per org after install |
| Default access | Often open to self-authorization | Restricted until the admin grants it |
| Secret handling | Secret visible on the record to users with access | Secret access controlled more tightly |
| Metadata types | ConnectedApp | Several ExternalClientApp types |
| Status | Legacy, still supported | Recommended for new work |
How the pieces fit together
The ECA sits between the external client and the OAuth endpoints. When a client requests a token, Salesforce checks the settings (is this flow and scope enabled for this app?) and then the policies (is this user allowed, from this IP, with this refresh token rule?).
Both checks must pass. A correct settings configuration does not help if the policies block the user, and the reverse is also true.
What stays the same
Most of what you learned about OAuth carries over unchanged.
- The token endpoint is the same, for example
https://MyDomain.my.salesforce.com/services/oauth2/token. - The supported flows are the same ones you already know: authorization code with PKCE, JWT bearer, and client credentials.
- Scopes mean the same thing, and the access token you receive is used the same way.
You can confirm a token works regardless of the app type:
curl https://MyDomain.my.salesforce.com/services/data/ \
-H "Authorization: Bearer $ACCESS_TOKEN"A successful call returns the list of REST API versions. A 401 response means the token is invalid or expired.
What changes in practice
Expect these differences when you work with ECAs.
- You create the app in a different place. In Setup, use the External Client App Manager instead of App Manager.
- You configure policies separately. After you save settings, you open the policies area to decide who may use the app. An app with no policy configuration may reject every user.
- Distribution is explicit. An ECA is either local to one org or packaged for installation in others. The distribution chapter covers this choice.
- Metadata is split. Source-driven deployment uses separate metadata types for settings and policies, so you can deploy settings everywhere and keep policies per org.
- Some features differ. Not every connected app feature has an ECA equivalent at the same level of support. Check the current Salesforce documentation for your release before you commit to a migration date.
Common mistakes
- Treating the ECA as a rename. If you copy values from a connected app and skip the policy step, users get access errors even though the settings look right.
- Expecting retroactive change. Creating an ECA does not change any existing connected app. The two types can coexist in one org.
- Putting org-specific rules in settings. Rules such as IP ranges belong in policies. Putting them in settings defeats the point of the split.
- Assuming the consumer key carries over. An ECA has its own consumer key. Clients must be updated when you migrate.
A short decision guide
Use an ECA when you are building a new integration, when you plan to distribute the app to other orgs, or when you want developers and admins to work independently. Keep an existing connected app when it works, when you rely on a feature that ECAs do not yet support, or when you have no capacity to migrate yet. Schedule the move, though, because ECAs are the direction Salesforce is taking.
Exercise
Your team packages an integration for several customer orgs. Each customer wants different IP restrictions and a different refresh token lifetime. Explain why an ECA suits this better than a connected app, and name which part of the ECA each customer would edit.
Show answer
An ECA separates settings from policies. You ship the settings (scopes, callback URLs, enabled flows) in the package, and each customer admin sets their own policies (IP relaxation, refresh token behavior, permitted users) in their org. With a connected app, the policies ship inside the same record as the settings, so customers would edit the record the publisher also controls, which complicates upgrades. Each customer edits the ECA policies.
Exercise
A new ECA has correct scopes, an enabled JWT bearer flow, and a valid callback URL, but every token request is rejected for the integration user. Which part do you check first, and why?
Show answer
Check the policies. The settings already look correct, and an ECA restricts access until an admin configures policies. The most likely cause is that the user is not permitted by the policy, for example no permission set or profile has been assigned for the app.