Sub topic 13
ECA settings versus policies
This chapter assumes you know what an external client app (ECA) is, how OAuth scopes and flows work, and how connected app policies such as permitted users and IP relaxation behave. It covers how an ECA splits one configuration into two parts and why.
Two layers instead of one
A connected app mixes everything in one record. The developer's OAuth settings and the admin's access rules sit on the same page. In an org where one team builds an app and another installs it, that mix causes trouble. Whoever edits the record can change both.
An ECA separates the two concerns:
- Settings describe what the app is and what it asks for. The developer owns them.
- Policies describe how a particular org lets the app run. The admin owns them.
| Layer | Owner | Examples |
|---|---|---|
| Settings | Developer | Callback URLs, scopes, enabled flows, PKCE requirement, consumer key and secret |
| Policies | Org admin | Permitted users, IP relaxation, refresh token policy, session timeout, run-as user for client credentials |
Settings travel with the app when you package it. Policies stay in the org that installed it. This is the main reason ECAs suit packaging and distribution.
How the layers interact
A token request must satisfy both layers. Settings decide what the app may ask for. Policies decide whether this org will grant it. For example:
- If a flow is not enabled in the settings, no policy can make it work.
- If the settings enable the JWT bearer flow but the policy limits access to pre-authorized users, only users with an assigned profile or permission set can get a token.
- A scope listed in the settings can still be useless to a user whose permissions do not allow the underlying data.
Policies can only narrow what the settings allow. They never add capabilities.
Where the work happens in Setup
In Setup, search for External Client App Manager. Each ECA has a Settings tab and a Policies tab. Edit the OAuth settings first, then switch to policies. A common order of work is:
- Create the ECA and enable OAuth in the settings.
- Enter the callback URL and select the minimum scopes.
- Choose the flows the app needs, for example PKCE for a web app.
- Open the policies and set permitted users, IP relaxation, and the refresh token policy.
- Assign profiles or permission sets for users who need access.
Common mistakes
- Fixing a policy problem in the settings. If a user is denied access, check the policy and the user's permission assignment first. Changing scopes will not help.
- Assuming policies ship in a package. An installing admin must set policies in the target org. Document your recommended values.
- Loosening policies to debug. Relaxing IP restrictions or permitted users to get past an error leaves the loosened rule in place. Restore it afterward.
Exercise
A developer packages an ECA with the JWT bearer flow enabled. After installation, the integration user gets an "user hasn't approved this consumer" style denial. Which layer should the admin check first, and why?
Show answer
The policies layer. Settings already enable the flow, so the denial comes from the org's policies. The admin should check the permitted users policy and confirm the integration user's profile or permission set is assigned to the app. Policies are set per org and do not come with the package.