forcedotcom/sf-skills / plugins/builder/integration/skills/integration-connectivity-connected-app-configure
integration-connectivity-connected-app-configure
VerifiedSalesforce 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).
| File | Kind | Size |
|---|---|---|
| README.md | markdown | 2.9 KB |
| SKILL.md | skill md | 10.7 KB |
| assets/connected-app-basic.xml | config | 1.0 KB |
| assets/connected-app-canvas.xml | config | 2.1 KB |
| assets/connected-app-jwt.xml | config | 1.9 KB |
| assets/connected-app-oauth.xml | config | 2.3 KB |
| assets/eca-global-oauth.xml | config | 1.9 KB |
| assets/eca-oauth-settings.xml | config | 1.4 KB |
| assets/eca-policies.xml | config | 1.3 KB |
| assets/external-client-app.xml | config | 1.6 KB |
| references/example-usage.md | markdown | 8.5 KB |
| references/migration-guide.md | markdown | 8.5 KB |
| references/oauth-flows-reference.md | markdown | 18.0 KB |
| references/security-checklist.md | markdown | 5.8 KB |
| references/testing-validation-guide.md | markdown | 9.9 KB |
references/security-checklist.md
View on GitHub<!-- Parent: integration-connectivity-connected-app-configure/SKILL.md -->
# Security Checklist for Connected Apps & ECAs
Use this checklist before deploying any OAuth application to production.
## Pre-Deployment Checklist
### OAuth Configuration
- [ ] **Callback URLs are specific** (no wildcards)
- [ ] **All URLs use HTTPS** (required for production)
- [ ] **PKCE is enabled** for public clients (mobile, SPA)
- [ ] **Consumer secret is protected** (not in source control)
- [ ] **Minimal scopes selected** (principle of least privilege)
- [ ] **No deprecated scopes** in use
### Token Policies
- [ ] **Access token expiration** is configured appropriately
- [ ] **Refresh token policy** matches use case
- `infinite` only for trusted server applications
- `specific_lifetime` for user-facing apps
- `zero` for JWT Bearer flows
- [ ] **Token rotation enabled** for ECAs in production
- [ ] **IP restrictions configured** for server-to-server apps
### Access Control
- [ ] **Admin pre-authorization** required for sensitive apps
- [ ] **User assignment via Permission Set** or Profile
- [ ] **Connected App policies** reviewed in Setup
- [ ] **High Assurance session** required if needed
### External Client Apps (Additional)
- [ ] **Distribution state** correctly set (Local vs Packageable)
- [ ] **Consumer key rotation** enabled for production
- [ ] **Consumer secret rotation** enabled for production
- [ ] **Policies file** reviewed after first deployment
---
## Security Scoring Criteria
### Critical (Block Deployment)
| Issue | Impact | Fix |
|-------|--------|-----|
| Wildcard callback URL | Token hijacking | Use specific URLs |
| HTTP callback URL | Credential interception | Use HTTPS only |
| Full scope without justification | Over-privileged access | Use minimal scopes |
| Consumer secret in code | Credential leak | Use environment variables |
### High Priority
| Issue | Impact | Fix |
|-------|--------|-----|
| PKCE disabled for mobile/SPA | Auth code interception | Enable PKCE |
| No IP restrictions (server) | Unauthorized access | Configure IP ranges |
| Infinite refresh tokens (user app) | Long-term compromise | Set expiration |
| No token rotation (ECA) | Compromised credentials | Enable rotation |
### Medium Priority
| Issue | Impact | Fix |
|-------|--------|-----|
| Missing description | Audit difficulty | Add clear description |
| Generic contact email | Incident response delay | Use team email |
| Introspection disabled | Token validation gaps | Enable if needed |
| No logout URL | Session persistence | Configure logout |
---
## Scope Security Guide
### Recommended Scopes by Use Case
| Use Case | Recommended Scopes |
|----------|-------------------|
| API Integration | `Api`, `RefreshToken` |
| User Authentication | `OpenID`, `Profile`, `Email` |
| Full API + Identity | `Api`, `RefreshToken`, `OpenID`, `Profile` |
| Chatter Integration | `Api`, `ChatterApi` |
| Server-to-Server | `Api` only |
### Scopes to Avoid
| Scope | Risk | Alternative |
|-------|------|-------------|
| `Full` | Complete access to everything | Use specific scopes |
| `Web` + `Api` together | Redundant, increases attack surface | Choose one |
| `RefreshToken` for JWT | Unnecessary, JWT generates new tokens | Remove scope |
---
## IP Restriction Policies
### Policy Options
| Policy | Description | Use Case |
|--------|-------------|----------|
| `ENFORCE` | Strict IP enforcement | Production server-to-server |
| `BYPASS` | No IP restrictions | Development only |
| `ENFORCE_ACTIVATED_USERS` | Enforce for active users | Mixed environments |
### Recommended Configuration
```xml
<!-- Production: Server-to-Server -->
<oauthPolicy>
<ipRelaxation>ENFORCE</ipRelaxation>
</oauthPolicy>
<!-- Production: User-Facing -->
<oauthPolicy>
<ipRelaxation>ENFORCE_ACTIVATED_USERS</ipRelaxation>
</oauthPolicy>
<!-- Development Only -->
<oauthPolicy>
<ipRelaxation>BYPASS</ipRelaxation>
</oauthPolicy>
```
---
## Certificate Management (JWT Bearer)
### Certificate Requirements
- [ ] RSA 2048-bit or higher key size
- [ ] Valid not-before and not-after dates
- [ ] Uploaded to Salesforce Certificate and Key Management
- [ ] Private key stored securely (HSM, Vault, secure storage)
### Certificate Rotation
1. Generate new certificate before expiration
2. Upload new certificate to Salesforce
3. Update Connected App to use new certificate
4. Update external system with new private key
5. Test authentication
6. Remove old certificate after transition period
---
## Monitoring & Audit
### What to Monitor
- [ ] **Login History** for Connected App users
- [ ] **OAuth Usage** in Setup
- [ ] **Event Monitoring** for token events (Shield required)
- [ ] **API Usage** limits and patterns
### Audit Checklist
- [ ] Review Connected Apps quarterly
- [ ] Remove unused applications
- [ ] Rotate credentials annually
- [ ] Verify scope appropriateness
- [ ] Check for policy violations
---
## Incident Response
### If Credentials Are Compromised
1. **Immediately** rotate Consumer Secret
2. Revoke all active tokens
3. Review login and access logs
4. Update external systems with new credentials
5. Investigate scope of compromise
6. Document and report incident
### Commands for Response
```bash
# List all Connected Apps
sf org list metadata --metadata-type ConnectedApp --target-org <org>
# Retrieve for review
sf project retrieve start --metadata ConnectedApp:<AppName> --target-org <org>
```
---
## Compliance Considerations
### GDPR/Privacy
- Ensure data access matches user consent
- Document data flows through Connected Apps
- Implement data retention policies
### SOC 2
- Enable audit logging
- Implement access reviews
- Document security controls
- Use certificate-based authentication
### HIPAA
- Enable High Assurance sessions
- Restrict data access scopes
- Implement IP restrictions
- Use encrypted connections only
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |