
Handles Salesforce OAuth configuration for Connected Apps and the newer External Client Apps pattern. Triggers when you're touching `.connectedApp-meta.xml` or `.eca-meta.xml` files, setting up JWT bearer flows, or making PKCE and scope decisions. Includes scoring across 120 points and templates for common auth patterns. The guidance steers you toward ECAs for new work since Spring '26 disabled new Connected App creation by default, but it covers both models. Worth noting it delegates Named Credential runtime config to sf-integration and won't help with the actual Apex token handling code. The security checklist and flow decision tables are the real value here if you're tired of getting OAuth setups wrong.
$ npx -y skills add jaganpro/sf-skills --skill sf-connected-apps --agent claude-codeInstalls into .claude/skills of the current project.
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.
Use sf-connected-apps when the work involves:
.connectedApp-meta.xml or .eca-meta.xml filesDelegate elsewhere when the user is:
| If the need is... | Prefer |
|---|---|
| simple single-org OAuth app | Connected App |
| new development with better secret handling | External Client App |
| multi-org / packaging / stronger operational controls | External Client App |
| straightforward legacy compatibility | Connected App |
Default guidance:
Ask for or infer:
Decide whether a Connected App or ECA is the better long-term fit.
| Use case | Default flow |
|---|---|
| backend web app | Authorization Code |
| SPA / mobile / public client | Authorization Code + PKCE |
| server-to-server / CI/CD | JWT Bearer |
| device / CLI auth | Device Flow |
| service account style app | Client Credentials (typically ECA) |
Use the provided assets instead of building from scratch:
assets/connected-app-basic.xmlassets/connected-app-oauth.xmlassets/connected-app-jwt.xmlassets/external-client-app.xmlassets/eca-global-oauth.xmlassets/eca-oauth-settings.xmlassets/eca-policies.xmlIf 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>Favor:
Before handoff, confirm:
Avoid these anti-patterns:
| Anti-pattern | Why it fails |
|---|---|
| wildcard / overly broad callback URLs | token interception risk |
Full scope by default | unnecessary privilege |
| PKCE disabled for public clients | code interception risk |
| consumer secret committed to source | credential exposure |
| no rotation / cert strategy for automation | brittle long-term ops |
Default fix direction:
Usually lives under:
force-app/main/default/connectedApps/Current source-supported ECA metadata uses multiple top-level source directories, not a single externalClientApps/ folder:
force-app/main/default/externalClientApps/ → ExternalClientApplication (.eca-meta.xml)force-app/main/default/extlClntAppGlobalOauthSets/ → ExtlClntAppGlobalOauthSettings (.ecaGlblOauth-meta.xml)force-app/main/default/extlClntAppOauthSettings/ → ExtlClntAppOauthSettings (.ecaOauth-meta.xml)force-app/main/default/extlClntAppOauthSecuritySettings/ → ExtlClntAppOauthSecuritySettings (.ecaOauthSecurity-meta.xml)force-app/main/default/extlClntAppOauthPolicies/ → ExtlClntAppOauthConfigurablePolicies (.ecaOauthPlcy-meta.xml)force-app/main/default/extlClntAppPolicies/ → ExtlClntAppConfigurablePolicies (.ecaPlcy-meta.xml)Important file-name gotchas:
.ecaGlblOauth, not .ecaGlobalOauth.ecaPlcy, not .ecaPolicy.ecaOauthSecurity for ExtlClntAppOauthSecuritySettingsWhen finishing, report in this order:
Suggested 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>
| Need | Delegate to | Reason |
|---|---|---|
| Named Credential / callout runtime config | sf-integration | runtime integration setup |
| deploy app metadata | sf-deploy | org validation and deployment |
| Apex token or refresh handling | sf-apex | implementation logic |
| permission review after deployment | sf-permissions | access governance |
| Score | Meaning |
|---|---|
| 80+ | production-ready OAuth app config |
| 54–79 | workable but needs hardening review |
| < 54 | block deployment until fixed |
Sponsors