Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
forcedotcom avatar

Configuring Connected Apps

  • 2.3k installs
  • 763 repo stars
  • Updated July 24, 2026
  • forcedotcom/sf-skills

configuring-connected-apps sets up Salesforce Connected Apps and ECAs with OAuth flows, templates, and security hardening.

About

The configuring-connected-apps skill guides OAuth app setup in Salesforce via Connected App or External Client App metadata including auth code, PKCE, JWT bearer, device, and client credentials flows. First decision table prefers ECA for new regulated or packageable solutions and Connected Apps for simple single-org legacy compatibility, noting Spring 26 disables new Connected App creation by default. Workflow chooses app model, OAuth flow by client type, loads XML templates from assets rather than scratch builds, applies a 120-point security checklist, and validates deployment readiness. Rules forbid committing consumer secrets, default Full scope, wildcard callbacks, or creating ECA OAuth security settings without org retrieve first. Metadata paths span connectedApps, externalClientApps, and multiple extlClntApp directories with abbreviated suffixes like ecaGlblOauth. Error handling covers DUPLICATE_VALUE, INVALID_CROSS_REFERENCE_KEY, and INSUFFICIENT_ACCESS_OR_READONLY with stop-on-failure guidance. Delegates Named Credential callouts, metadata deploy-only tasks, and Apex token code to sibling skills.

  • Connected App vs External Client App decision with Spring 26 defaults.
  • OAuth flow selection for web, SPA, server-to-server, device, and service accounts.
  • Template-driven metadata from assets; retrieve ECA security settings from org first.
  • 120-point security checklist: PKCE, least privilege scopes, no secrets in source.
  • Gotchas for ecaGlblOauth suffixes and consumer key post-deploy retrieve.

Configuring Connected Apps by the numbers

  • 2,310 all-time installs (skills.sh)
  • +8 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #205 of 2,209 Security skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

configuring-connected-apps capabilities & compatibility

Capabilities
connected app vs eca architecture decision guida · oauth flow selection by client type · template based metadata generation paths · security checklist and deployment validation · metadata suffix and retrieve first gotchas
Use cases
security audit · api development
From the docs

What configuring-connected-apps says it does

Never commit consumer secrets to source control
SKILL.md
Spring '26: new Connected Apps disabled by default
SKILL.md
ECA OAuth security settings must be retrieved from org before editing
SKILL.md
npx skills add https://github.com/forcedotcom/sf-skills --skill configuring-connected-apps

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2.3k
repo stars763
Security audit3 / 3 scanners passed
Last updatedJuly 24, 2026
Repositoryforcedotcom/sf-skills

How do I configure Salesforce OAuth apps with the right flow, metadata files, and security controls?

Configure Salesforce Connected Apps and External Client Apps OAuth flows, JWT bearer, scopes, and metadata with security hardening.

Who is it for?

Salesforce integrators authoring OAuth for web, mobile, or server-to-server clients.

Skip if: Skip for Named Credential callout setup or Apex-only token handling without app metadata.

When should I use this skill?

User touches connectedApp-meta.xml, eca-meta.xml, OAuth flows, JWT bearer, or PKCE for Salesforce.

What you get

Deployment-ready connectedApp or ECA metadata with validated scopes, callbacks, and no embedded secrets.

  • ConnectedApp metadata XML
  • OAuth configuration block

Files

SKILL.mdMarkdownGitHub ↗

configuring-connected-apps: Salesforce Connected Apps & External Client Apps

Use this skill when the user needs OAuth app configuration in Salesforce: Connected Apps, External Client Apps (ECAs), JWT bearer setup, PKCE decisions, scope design, or migration from older Connected App patterns to newer ECA patterns.

Scope

In scope:

  • .connectedApp-meta.xml or .eca-meta.xml files
  • OAuth flow selection and callback / scope setup
  • JWT bearer auth, device flow, client credentials, or auth-code decisions
  • Connected App vs External Client App architecture choices
  • Consumer key / secret / certificate handling strategy

Out of scope — delegate elsewhere:

  • Configuring Named Credentials or runtime callouts → building-sf-integrations
  • Deploying metadata to orgs → deploying-metadata
  • Writing Apex token-handling code → generating-apex

---

First Decision: Connected App or External Client App

If the need is...Prefer
simple single-org OAuth appConnected App
new development with better secret handlingExternal Client App
multi-org / packaging / stronger operational controlsExternal Client App
straightforward legacy compatibilityConnected App

Default guidance:

  • Choose ECA for new regulated, packageable, or automation-heavy solutions.
  • Choose Connected App when simplicity and legacy compatibility matter more.
  • Spring '26 note: creation of new Connected Apps is disabled by default in orgs. For new integrations, prefer External Client Apps unless Connected App compatibility is explicitly required.

---

Required Inputs

Ask for or infer:

  • App type: Connected App or ECA
  • OAuth flow: auth code, PKCE, JWT bearer, device, client credentials
  • Client type: confidential vs public
  • Callback URLs / redirect surfaces
  • Required scopes
  • Distribution model: local org only vs packageable / multi-org
  • Whether certificates or secret rotation are required

---

Workflow

1. Choose the app model

Decide whether a Connected App or ECA is the better long-term fit using the decision table above.

2. Choose the OAuth flow

Use caseDefault flow
backend web appAuthorization Code
SPA / mobile / public clientAuthorization Code + PKCE
server-to-server / CI/CDJWT Bearer
device / CLI authDevice Flow
service account style appClient Credentials (typically ECA)

3. Start from the right template

Read the appropriate template before generating — do not build from scratch:

TemplateUse case
assets/connected-app-basic.xmlSimple API integration, minimal OAuth
assets/connected-app-oauth.xmlWeb app with full OAuth 2.0 configuration
assets/connected-app-jwt.xmlJWT bearer / server-to-server
assets/connected-app-canvas.xmlEmbedding external apps in Salesforce UI (Canvas)
assets/external-client-app.xmlECA header file — all new ECA builds start here
assets/eca-global-oauth.xmlECA global OAuth settings (scopes, PKCE, rotation)
assets/eca-oauth-settings.xmlECA per-app OAuth settings
assets/eca-policies.xmlECA configurable policies

If you need source-controlled ECA OAuth security metadata, retrieve it from an org first and treat the retrieved file as the schema source of truth:

sf project retrieve start --metadata ExtlClntAppOauthSecuritySettings:<AppName> --target-org <alias>

4. Apply security hardening

Read references/security-checklist.md for the full 120-point security checklist. Favor:

  • Least-privilege scopes
  • Explicit callback URLs
  • PKCE for public clients
  • Certificate-based auth where appropriate
  • Rotation-ready secret / key handling
  • IP restrictions when realistic and maintainable

5. Validate deployment readiness

Read references/testing-validation-guide.md before handoff. Confirm:

  • Metadata file naming is correct (see Gotchas below)
  • Scopes are justified
  • Callback and auth model match the real client type
  • Secrets are not embedded in source

6. Handle errors

If deployment fails, check the error output for:

  • DUPLICATE_VALUE — a Connected App or ECA with this name already exists; rename or retrieve-then-update instead
  • INVALID_CROSS_REFERENCE_KEY — the externalClientApplication name in an ECA settings file doesn't match the .eca-meta.xml filename exactly
  • INSUFFICIENT_ACCESS_OR_READONLY — user lacks the "Manage Connected Apps" permission
  • If any step fails, do not proceed to the next step — surface the error to the user with the specific message above

---

Rules / Constraints

RuleRationale
Never commit consumer secrets to source controlCredential exposure risk
Never use Full scope by defaultUnnecessary privilege; request only what the app needs
Always use PKCE for public clients (mobile, SPA)Prevents auth code interception
Never use wildcard or overly broad callback URLsToken interception risk
ECA OAuth security settings must be retrieved from org before editingFile schema is not fully documented; retrieve-first ensures accuracy
Use <alias> placeholders in CLI commands, never hardcoded org URLsOrg URLs vary per environment
Detect actual packageDirectory from sfdx-project.json before writing filesProjects may not use the default force-app/main/default/ layout

---

Metadata Notes That Matter

Connected App

Default source location (verify via sfdx-project.json → packageDirectories):

  • <packageDir>/connectedApps/

External Client App

ECA metadata spans multiple top-level source directories. Default locations (verify via sfdx-project.json):

DirectoryMetadata typeFile suffix
<packageDir>/externalClientApps/ExternalClientApplication.eca-meta.xml
<packageDir>/extlClntAppGlobalOauthSets/ExtlClntAppGlobalOauthSettings.ecaGlblOauth-meta.xml
<packageDir>/extlClntAppOauthSettings/ExtlClntAppOauthSettings.ecaOauth-meta.xml
<packageDir>/extlClntAppOauthSecuritySettings/ExtlClntAppOauthSecuritySettings.ecaOauthSecurity-meta.xml
<packageDir>/extlClntAppOauthPolicies/ExtlClntAppOauthConfigurablePolicies.ecaOauthPlcy-meta.xml
<packageDir>/extlClntAppPolicies/ExtlClntAppConfigurablePolicies.ecaPlcy-meta.xml

---

Gotchas

GotchaDetail
.ecaGlblOauth not .ecaGlobalOauthThe global OAuth suffix is abbreviated — using the long form will break deployment
.ecaPlcy not .ecaPolicySame abbreviation pattern — the general policy suffix is short form
.ecaOauthSecurity for security settingsUse .ecaOauthSecurity, not .ecaSecurity
ECA OAuth security settings are retrieve-onlyCannot be created from scratch in source — always retrieve from org first
Spring '26: new Connected Apps disabled by defaultNew orgs block Connected App creation; use ECA unless explicitly required
Consumer key is generated post-deployYou cannot set the consumer key in metadata — retrieve it after first deployment

---

Output Expectations

When finishing, confirm and report in this order:

1. App type chosen — Connected App or External Client App 2. OAuth flow chosen 3. Files created or updated — list each metadata file path 4. Security decisions — scopes, PKCE, certs, secrets, IP policy 5. Next deployment / testing step

Suggested output shape:

App: <name>
Type: Connected App | External Client App
Flow: <oauth flow>
Files: <paths>
Security: <scopes, PKCE, certs, secrets, IP policy>
Next step: <deploy, retrieve consumer key, or test auth flow>
Score: <x>/120

---

Cross-Skill Integration

NeedDelegate toReason
Named Credential / callout runtime configbuilding-sf-integrationsruntime integration setup
Deploy app metadatadeploying-metadataorg validation and deployment
Apex token or refresh handlinggenerating-apeximplementation logic

---

Score Guide

ScoreMeaning
80+production-ready OAuth app config
54–79workable but needs hardening review
< 54block deployment until fixed

---

Reference File Index

FileWhen to read
assets/connected-app-basic.xmlStep 3 — template for simple Connected App with minimal OAuth
assets/connected-app-oauth.xmlStep 3 — template for full OAuth 2.0 Connected App
assets/connected-app-jwt.xmlStep 3 — template for JWT bearer / server-to-server Connected App
assets/connected-app-canvas.xmlStep 3 — template for Canvas app embedding in Salesforce UI
assets/external-client-app.xmlStep 3 — ECA header file template
assets/eca-global-oauth.xmlStep 3 — ECA global OAuth settings template (PKCE, rotation, callbacks)
assets/eca-oauth-settings.xmlStep 3 — ECA per-app OAuth settings template
assets/eca-policies.xmlStep 3 — ECA configurable policies template
references/oauth-flows-reference.mdStep 2 — detailed OAuth flow comparison and decision guide
references/security-checklist.mdStep 4 — full 120-point security scoring checklist
references/testing-validation-guide.mdStep 5 — pre-deployment validation and testing guide
references/migration-guide.mdWhen migrating from Connected App to ECA patterns
references/example-usage.mdFull end-to-end examples for common OAuth scenarios

Related skills

Forks & variants (1)

Configuring Connected Apps has 1 known copy in the catalog totaling 526 installs. They canonicalize to this original listing.

How it compares

Use this over manual Setup UI clicks when you want version-controlled, repeatable Connected App metadata across dev, staging, and production orgs.

FAQ

Connected App or ECA for new work?

Prefer External Client App for new regulated or packageable solutions; Connected Apps are for simple legacy single-org cases.

Can I create ECA OAuth security settings from scratch?

No. Retrieve ExtlClntAppOauthSecuritySettings from the org first; the file schema is retrieve-only.

May consumer secrets live in git?

Never commit consumer secrets; consumer keys are generated post-deploy and must be retrieved from the org.

Is Configuring Connected Apps safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Securitysecretsappsec

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.