PluginBench
Skill
Pass
Audit score 90

integration-connectivity-connected-app-configure

forcedotcom/sf-skills

Configure Salesforce Connected Apps and External Client Apps with OAuth, JWT, and security hardening.

What is integration-connectivity-connected-app-configure?

This skill handles OAuth flow setup, JWT bearer authentication, and Connected App vs. External Client App configuration in Salesforce. Use it when configuring OAuth scopes, callback URLs, authentication methods, or editing .connectedApp-meta.xml and .eca-meta.xml files.

  • Choose between Connected App and External Client App architectures based on distribution and security needs
  • Select and configure OAuth flows: Authorization Code, PKCE, JWT Bearer, Device Flow, or Client Credentials
  • Design least-privilege scopes and explicit callback URLs with security hardening
  • Generate and validate metadata files across multiple ECA directories (externalClientApps, extlClntAppOauthSettings, extlClntAppOauthSecuritySettings, etc.)
  • Apply 120-point security checklist covering secret rotation, PKCE enforcement, IP restrictions, and certificate-based auth
  • Troubleshoot deployment errors including DUPLICATE_VALUE, INVALID_CROSS_REFERENCE_KEY, and permission issues

How to install integration-connectivity-connected-app-configure

npx skills add https://github.com/forcedotcom/sf-skills --skill integration-connectivity-connected-app-configure
Prerequisites
  • Salesforce CLI (sf) version 2.0.0 or later
  • curl (≥7.0.0), jq (≥1.7.0), openssl (≥1.1.0), python3 (≥3.10.0)
  • Salesforce org with API version 57.0 or later
  • User permission: "Manage Connected Apps"
  • sfdx-project.json with correct packageDirectories configured
Claude Code
Cursor
Windsurf
Cline

How to use integration-connectivity-connected-app-configure

  1. 1.Determine whether your use case requires a Connected App or External Client App using the decision table (ECA preferred for new regulated/packageable solutions)
  2. 2.Select the appropriate OAuth flow based on your client type: Authorization Code for web apps, PKCE for public clients, JWT Bearer for server-to-server, Device Flow for CLI
  3. 3.Read the relevant template file from assets/ (connected-app-oauth.xml, external-client-app.xml, eca-global-oauth.xml, etc.) as your starting point
  4. 4.Define required scopes using least-privilege principle and explicit callback URLs matching your actual client configuration
  5. 5.Apply security hardening from references/security-checklist.md including PKCE for public clients, certificate-based auth, and rotation-ready secret handling
  6. 6.Validate metadata file naming matches the correct suffixes (.eca-meta.xml, .ecaOauth-meta.xml, .ecaOauthSecurity-meta.xml, .ecaPlcy-meta.xml)
  7. 7.Deploy metadata and verify callback URLs, scopes, and auth model match your real client before handoff

Use cases

Good for
  • Setting up a backend web app with Authorization Code OAuth flow and JWT bearer fallback
  • Configuring a mobile or SPA client with PKCE to prevent auth code interception
  • Migrating legacy Connected Apps to External Client Apps for better secret handling and multi-org support
  • Designing server-to-server authentication for CI/CD pipelines using JWT bearer tokens
  • Implementing device flow authentication for CLI tools or headless integrations
Who it's for
  • Integration architects designing OAuth security models
  • Salesforce developers building connected applications
  • DevOps engineers setting up CI/CD authentication
  • Security-focused teams implementing credential rotation and IP restrictions
  • Teams migrating from Connected Apps to External Client Apps

integration-connectivity-connected-app-configure FAQ

When should I use Connected App vs. External Client App?

Use Connected App for simple single-org OAuth or legacy compatibility. Use External Client App (ECA) for new development, multi-org/packaging scenarios, better secret handling, and regulated environments. Spring '26 note: new Connected App creation is disabled by default; prefer ECA for new integrations unless legacy compatibility is required.

What OAuth flow should I choose for my use case?

Use Authorization Code for backend web apps, Authorization Code + PKCE for SPAs/mobile/public clients, JWT Bearer for server-to-server/CI/CD, Device Flow for CLI auth, and Client Credentials for service account style apps.

Why is PKCE required for public clients?

PKCE (Proof Key for Code Exchange) prevents authorization code interception attacks. It is mandatory for public clients like mobile apps and single-page applications that cannot securely store a client secret.

What should I do if I get a DUPLICATE_VALUE deployment error?

A Connected App or ECA with that name already exists in the org. Either rename your app or retrieve the existing metadata from the org and update it instead of creating a new one.

Should I commit consumer secrets to source control?

Never commit secrets to source control. Use environment variables, secure vaults, or org-specific configuration to manage consumer keys, secrets, and certificates outside of version control.

Full instructions (SKILL.md)

Source of truth, from forcedotcom/sf-skills.


name: integration-connectivity-connected-app-configure description: "Salesforce Connected Apps and External Client Apps OAuth configuration with 120-point scoring. Use this skill to configure OAuth flows, JWT bearer auth, Connected Apps, and External Client Apps in Salesforce. TRIGGER when: user configures OAuth flows, JWT bearer auth, Connected Apps, ECAs, or touches .connectedApp-meta.xml / .eca-meta.xml files. DO NOT TRIGGER when: configuring Named Credentials for callouts (use integration-connectivity-generate), reviewing permission policies (use platform-metadata-deploy), or writing Apex token-handling code (use platform-apex-generate)." allowed-tools: Bash Read Write Edit Glob Grep WebFetch AskUserQuestion TodoWrite metadata: version: "1.1" domains: ["Integration"] minApiVersion: "57.0" relatedSkills: - "integration-connectivity-generate" - "platform-apex-generate" - "platform-metadata-deploy" cliTools: - tool: ["curl"] semver: ">=7.0.0" - tool: ["jq"] semver: ">=1.7.0" - tool: ["openssl"] semver: ">=1.1.0" - tool: ["python3"] semver: ">=3.10.0" - tool: ["sf"] semver: ">=2.0.0"

integration-connectivity-connected-app-configure: 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 → integration-connectivity-generate
  • Deploying metadata to orgs → the platform-metadata-deploy skill
  • Writing Apex token-handling code → the platform-apex-generate skill

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 configintegration-connectivity-generateruntime integration setup
Deploy app metadataplatform-metadata-deploy skillorg validation and deployment
Apex token or refresh handlingplatform-apex-generate skillimplementation 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

More from forcedotcom/sf-skills and the wider catalog.

INintegration-connectivity-generate logo

integration-connectivity-generate

forcedotcom/sf-skills

Salesforce integration architecture: Named Credentials, External Services, REST/SOAP callouts, Platform Events, and CDC patterns.

5.3k installsAudited
INintegration-eventing-cdc-configure logo

integration-eventing-cdc-configure

forcedotcom/sf-skills

Enable and configure Salesforce Change Data Capture on objects with custom channels, filters, and enrichment fields.

5.1k installsAudited
INintegration-eventing-subscription-configure logo

integration-eventing-subscription-configure

forcedotcom/sf-skills

Create, read, update, and delete ManagedEventSubscription metadata for Salesforce platform event subscriptions.

5.1k installsAudited
INinvestigating-agentforce-architecture logo

investigating-agentforce-architecture

forcedotcom/sf-skills

Declared architecture snapshot for one Agentforce agent: planner, topics, actions, flows, Apex, prompt templates, and NGA plugins. Renders a human-readable architecture document and Mermaid invocation graph from design-time metadata (not runtime audit rows). TRIGGER when user asks to describe, diagram, inventory, audit, document, or diff (e.g. v3 vs v5) the architecture / action tree / topic structure / tool inventory of a specific agent by agent API name in a specific org. DO NOT TRIGGER for runtime session traces, conversation transcripts, generation timings, or gateway audit chains — this skill reads design-time metadata only (use investigating-agentforce-d360 for session traces).

836 installs
INinvestigating-agentforce-d360 logo

investigating-agentforce-d360

forcedotcom/sf-skills

Data Cloud 360° view of a single Agentforce session. TRIGGER when user asks to trace, inspect, summarize, or describe a specific Agentforce session by session id (Agent Session UUID `019d…` or MessagingSession id `0Mw…`). Also triggers on session discovery — find/list/search sessions by time, agent, channel, outcome, or conversation text — when the user has no session id yet. DO NOT TRIGGER for design-time architecture questions (use investigating-agentforce-architecture instead) or for runtime perf/latency/SLO questions that require platform telemetry beyond Data Cloud.

822 installs
MAmanaging-managed-event-subscription logo

managing-managed-event-subscription

forcedotcom/sf-skills

Create, read, update, and delete ManagedEventSubscription metadata in Salesforce. Use this skill for any work involving managed event subscriptions, platform event subscriptions, event channel subscribers, or .managedEventSubscription-meta.xml files. TRIGGER when: user asks to subscribe to a platform event, create a managed subscription, set up event replay, configure an event channel subscriber, update replay preset, activate or deactivate a subscription, delete a subscription, or manage ManagedEventSubscription metadata. SKIP when: user needs to create the platform event channel itself (use generating-platform-event skill) or needs Flow-based event subscriptions (use generating-flow skill).

820 installsAudited