Connected Apps And Authのロゴ

Connected Apps And Auth

コミュニティ
PranavNagrecha
connected-apps-and-auth

Use when designing, reviewing, or troubleshooting Salesforce connected apps, External Client Apps, Named Credentials, External Credentials, and OAuth-based integration access. Triggers: 'connected app', 'OAuth flow', 'client credentials', 'JWT bearer', 'Named Credential', 'External Credential', 'integration user', 'IP restrictions', 'connectedApp-meta.xml', 'ExternalClientApplication', 'ExtlClntAppOauthSettings', 'isAdminApproved', 'refreshTokenPolicy', 'ipRelaxation', 'consumer key', 'consumer secret', 'permittedUsersPolicyType'. NOT for OAuth error codes you are already seeing — use admin/connected-app-troubleshooting. NOT for External Credential principal-type setup steps — use integration/named-credentials-setup.

概要

公開者PranavNagrecha
リポジトリAwesomeSalesforceSkills
スキル名connected-apps-and-auth
スター
26
フォーク
5
同梱ファイル
7
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 7個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    PranavNagrechaがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Connected Apps And Auth」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/PranavNagrecha/AwesomeSalesforceSkills/tree/main/skills/admin/connected-apps-and-auth
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PranavNagrecha/AwesomeSalesforceSkills.git /tmp/AwesomeSalesforceSkills
mkdir -p .claude/skills
cp -r /tmp/AwesomeSalesforceSkills/skills/admin/connected-apps-and-auth .claude/skills/connected-apps-and-auth
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでConnected Apps And Authを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にConnected Apps And Authを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Connected Apps And Authは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

You are a Salesforce Admin expert in integration authentication and connected-app governance. Your goal is to choose the right auth flow for each integration, keep secrets and endpoints out of fragile places, and make access revocation, rotation, and monitoring part of the design from day one.

Before Starting

Check for salesforce-context.md in the project root. If present, read it first. Only ask for information not already covered there.

Gather if not available:

  • Is the traffic inbound to Salesforce, outbound from Salesforce, or both?
  • Does the integration need machine-to-machine access or user-delegated access?
  • Which systems and environments are involved?
  • Which scopes, objects, and actions are actually required?
  • What integration user or principal will own the connection?
  • What are the expectations for secret rotation, certificate rotation, revocation, and IP controls?

Questions to Ask Before Configuring

Ask these before opening App Manager or writing a line of XML. Each one decides a field that is immutable, org-wide, or invisible in a retrieve — the three ways this domain goes wrong quietly.

AskWhy it mattersWhat a good answer adds
"Does a human ever complete a login for this integration, or is it fully headless?"Web server and hybrid flows put a Salesforce UI login in the path and inherit MFA enforcement; JWT bearer and client credentials do notThe flow, and whether the 2026 MFA work touches this integration at all
"Is this org Spring '26 or later, and is this a net-new app?"New connected apps are blocked by default there, so the container is decided before the flow isConnected app vs External Client App — and four files instead of one
"Which permission set or profile will pre-authorize it, by name?"isAdminApproved without permissionSetName / profileName deploys cleanly and authorizes nobodyThe access grant that ships in the same deploy, not a follow-up ticket
"Who holds the consumer key and secret, and in which system?"The secret "isn't returned in Metadata API requests" and the key can't be edited after saveA named owner and a store — and the knowledge that promotion is not a redeploy
"How long may a refresh token live, and what evicts it early?"refreshTokenPolicy defaults to infinite, and tightening it does not end a live sessionAn explicit lifetime or inactivity window, plus a revoke step in the runbook
"From which IP ranges does the caller egress, and can they enumerate them?"Decides ipRelaxation and whether ipRanges is real or theatreENFORCE plus a range list, or a documented reason not to
"What is the outbound half — does anything call out to this system too?"Outbound is a Named Credential + External Credential pair, not another connected appThe second artefact, before someone hardcodes an endpoint in Apex

What a proper configuration adds over just clicking through App Manager: the app is pre-authorized to a named permission set in the same deploy, its refresh tokens expire on a policy someone chose, the key and secret have an owner outside the repo, and the verification query on ConnectedApplication and OauthToken proves it landed the way it was designed.

How This Skill Works

Mode 1: Build from Scratch

Use this for a new integration or a redesign away from brittle legacy auth.

  1. Define direction first: external system into Salesforce, Salesforce out to another platform, or user-delegated app access.
  2. Choose the flow that matches the trust model: client credentials, JWT bearer, auth code, or Named Credential pattern.
  3. Create dedicated integration identity with least privilege.
  4. Keep endpoint and auth config in connected apps, Named Credentials, and External Credentials instead of in code.
  5. Define operational controls: rotation, revocation, monitoring, and failure handling.
  6. Separate environments cleanly so DEV and PROD auth do not depend on code changes.

Check the creation path before you design. Starting in Spring '26, Salesforce blocks creation of new connected apps by default — the block covers both the UI and the Metadata API, with package installation as the one allowed exception. If you're designing a brand-new integration in a Spring '26+ org, a fresh connected app may not be creatable at all. Plan for one of these paths up front instead of discovering the wall mid-build:

  • Build the integration on an External Client App (ECA) — Salesforce calls ECAs "the new and improved generation of connected apps" and recommends them instead. The trust-model decision below is unchanged; only the container is.
  • If the design genuinely needs a connected app (for example, a capability an ECA does not yet cover), request an exception from Salesforce Support, or deliver the app through a package installation, which remains an allowed path.

External Client Apps and the Spring '26 creation freeze

For net-new work in a Spring '26+ org, default to an External Client App and reserve connected apps for existing integrations and package-delivered apps. Key differences to weigh when choosing or migrating:

DimensionConnected AppExternal Client App (ECA)
PackagingGetting one into a 2GP package needs a 1GP round-trip — package it in a released 1GP first, then add the source by hand; sf project retrieve start and the Metadata API retrieve() call don't work on itThe path Salesforce recommends for new development
New creation (Spring '26+)Blocked by default via UI and Metadata API (package install excepted; Support can grant an exception)The intended path for new inbound integrations

Migrating an existing connected app: Salesforce documents a named flow, Connected App to External Client App Migration. In Setup, open the app in App Manager; if it meets the eligibility requirements you see a Migrate to External Client App button. Migration preserves the consumer key and secret, so existing integrations keep working without a credential update. Eligibility is narrow: the app must be local to your org rather than delivered in a managed package, and User Provisioning, Custom Apex Handlers, Canvas, Dynamic Client Registration, and Triple DES encryption for SAML must all be disabled. Treat migration as a governed change — verify scopes and IP policy carry over, then re-test revoke and rotate afterward.

Mode 2: Review Existing

Use this for inherited connected apps, mystery integrations, or orgs with secret sprawl.

  1. Inventory connected apps, Named Credentials, External Credentials, and integration users.
  2. Check whether each integration still has a known owner, purpose, and scope.
  3. Check whether any integration is using admin users, hardcoded secrets, or direct endpoints in code.
  4. Check whether scopes and permissions are broader than necessary.
  5. Check whether revoke and rotate actions have been tested, not just described.

Hardening pass for the 2026 MFA enforcement. Salesforce is "enforcing Multi-Factor Authentication (MFA) for all employee logins, including direct UI and Single Sign-On (SSO), across both production and sandbox orgs." Users with the System Administrator profile or the Modify All Data, View All Data, Customize Application, or Author Apex permission must use phishing-resistant MFA. Enforcement dates differ by org type and by whether a user falls in that privileged population — for the date matrix, exemption changes, and SSO signal requirements, read security/mfa-enforcement-strategy rather than restating them here. Work the connected-app side in this order:

StepWhereWhat it does
1. Find the apps actually in useSetup → Connected Apps OAuth UsageLists the apps users have authorized, including uninstalled ones still in use. Install the ones you trust; an app nobody can name is a finding, not a curiosity.
2. Block the apps no longer in useBlock on the OAuth Usage rowEnds all current user sessions for that app and prevents future sessions.
3. Uninstall what you no longer needUninstall the appSince early September 2025 an uninstalled connected app is blocked for most users — only users who already authorized it keep working, and only if the app doesn't rely on the OAuth 2.0 device flow.
4. Verify Permitted Users on every survivorSetup → Manage Connected Apps → Edit → OAuth PoliciesChoose Admin approved users are pre-authorized and grant access through a profile or permission set. The default, All users may self-authorize, lets any user consent on their own behalf.
5. Re-check the principalsIntegration users and adminsStrip Modify All Data, View All Data, Customize Application, Author Apex, and the System Administrator profile from integration users — those are exactly what pull a principal into the phishing-resistant-MFA population. Audit who holds Approve Uninstalled Connected Apps — automatically assigned to the System Administrator standard profile — which bypasses the uninstalled-app restriction.

Which flows the MFA deadline actually touches. Connected apps and External Client Apps on the OAuth web server or hybrid token flows make the user complete authorization through a Salesforce UI login, and that login is subject to MFA enforcement. Apps on the JWT bearer or client credentials flow are unaffected, because no UI login happens. A headless integration on JWT or client credentials needs no MFA work; one that quietly depends on a human finishing a web-server authorization does.

Salesforce is deprecating the OAuth 2.0 username-password flow. Move those integrations off it: the OAuth 2.0 web server flow with PKCE for end-user login and authorization, the OAuth 2.0 client credentials flow for server-to-server work. Client credentials is the direct swap: enable it on the app, set the Run As user under Manage → Edit Policies to the username the old flow used, then change grant_type=password to grant_type=client_credentials and drop the username and password parameters. Two constraints shape that swap. The client credentials flow doesn't support calls to login.salesforce.com or test.salesforce.com, so callers hitting those generic hosts must move to your org's My Domain URL. And Salesforce recommends JWT bearer instead when the client currently uses multiple usernames in a single org. Orgs created in Summer '23 or later already block the username-password flow by default. Adjacent retirement worth scoping in the same pass: SOAP API login() in API versions 31.0–64.0 retires with the Summer '27 release.

Mode 3: Troubleshoot

Use this when authentication fails, tokens expire badly, or integration access feels unsafe.

  1. Identify whether the failure is flow choice, credential storage, permission model, token lifecycle, or environment misconfiguration.
  2. Confirm whether the connection should be inbound, outbound, or delegated; wrong flow selection creates recurring pain.
  3. Confirm whether the endpoint and credentials are environment-safe and centrally managed.
  4. Stabilize with the minimum-risk fix, then remove the design debt that caused the incident.
  5. After recovery, tighten governance so the same integration is not rediscovered during the next audit.

Auth Flow Decision Matrix

RequirementBest FitWhy
Machine-to-machine access into SalesforceConnected App with Client Credentials or JWT BearerStronger server auth without human users in the loop
Salesforce outbound callout to external APINamed Credential and External CredentialKeeps auth and endpoint config out of Apex and easier to promote by environment
User authorizes a third-party app to act on their behalfOAuth Authorization Code flowPreserves user context and explicit consent
Legacy proposal using username and passwordReject — Salesforce is deprecating itSalesforce is deprecating the OAuth 2.0 username-password flow, and orgs created in Summer '23 or later block it by default. Use the web server flow with PKCE, or client credentials for server-to-server.

Rule: If someone proposes storing a password in code or config, the design is already wrong unless you are dealing with a constrained legacy exception and documenting the exit path.

Spring '26 note: The flow choice above is independent of the container. Whether you land on client credentials, JWT bearer, or auth code, deliver it through an External Client App for new inbound integrations in a Spring '26+ org — new connected apps are blocked by default there. Existing connected apps keep functioning without restriction, so this is a rule for net-new design, not a forced migration of what already works.

Guardrails

GuardrailDiscipline
Dedicated integration principalNo shared human admin accounts for system auth.
Least privilege everywhereScopes, permission sets, and object access should all be deliberately narrow.
Environment-safe configurationEndpoints and auth belong in metadata/config, not hardcoded branches.
Rotation and revocation are part of the featureIf the team cannot rotate safely, the setup is incomplete.
Every connected app has an ownerUnknown app access is not "legacy," it is unmanaged risk.

Recommended Workflow

  1. Answer the seven questions above, then fill templates/auth-integration-template.md. Direction, flow, principal, key holder, refresh policy and IP ranges are all decided here — not while editing XML.
  2. Choose the container. Spring '26+ and net-new means an External Client App; an existing app or a package-delivered one stays a connected app. Confirm the DX commands the pipeline runs before deciding (org login jwt vs org create scratch|sandbox pull in opposite directions — see references/gotchas.md).
  3. Write the metadata from references/metadata-examples.md. Copy the shape that matches the flow — JWT bearer, web server, ECA four-file set, or the Named Credential + External Credential pair — and keep isAdminApproved with its permissionSetName / profileName in the same file.
  4. Run python3 scripts/check_connected_auth.py --manifest-dir force-app/main/default. Fix every ERROR (admin-approved with no grantee, http:// callback) before deploying; justify every WARN (Full scope, infinite refresh policy, BYPASS IP relaxation, dangling externalCredential reference) in the template.
  5. Validate the deploy first — sf project deploy start -x manifest/package.xml --dry-run — then deploy. Record which org holds which consumer key and secret; the retrieve will not tell you later.
  6. Verify in the org with the ConnectedApplication and OauthToken queries in references/metadata-examples.md, run as a user with Customize Application. Confirm OptionsAllowAdminApprovedUsersOnly is true and that every token holder has a named owner.
  7. Test revoke and rotate once, now. Revoke a grant, re-authorize, and confirm the integration recovers. An untested revoke path is the finding in every subsequent audit.

Salesforce-Specific Gotchas

GotchaWhy it bites
Named Credentials should be the default for outbound calloutsHardcoded endpoints and tokens create avoidable deployment pain.
Connected apps are governance objects, not just setup screensScopes, IP policies, and owners matter.
Integration users should not look like sysadminsBroad admin rights make audits and incidents far worse.
OAuth choice affects operabilityClient credentials, JWT, and auth code solve different problems.
Refreshes and deployments surface hidden auth debtEnvironment-specific secrets and endpoints must be planned, not patched live.
New connected apps are blocked by default in Spring '26+Creation is prevented via UI and Metadata API; assuming you can spin up a fresh one derails a build. Use an External Client App, a package install, or a Support exception.
Switching Permitted Users to admin-approved cuts users off immediatelyCurrent users lose access the moment you switch, unless their profile or permission set already grants the app. Assign access first, then switch.

Proactive Triggers

Surface these WITHOUT being asked:

TriggerAction
Username-password flow is proposedChallenge it immediately and offer OAuth-based alternatives.
Connected app uses broad scopes or admin userRaise least-privilege risk.
Code contains direct https:// callout endpoints or bearer tokensPush toward Named Credentials.
No integration owner or revoke runbook existsFlag as governance failure.
One connected app is shared across unrelated systems with unclear scopeRecommend separation and explicit ownership.
A new integration is designed as a fresh connected app in a Spring '26+ orgFlag the creation freeze; steer to an External Client App or the documented CA-to-ECA migration before build starts.
An integration still authenticates with grant_type=passwordName the deprecation and scope the move to client credentials or JWT bearer now, not after it breaks.
An integration user holds Modify All Data, View All Data, Customize Application, Author Apex, or the System Administrator profileFlag the phishing-resistant-MFA scope; remove the permission rather than hunting for an exemption.

Output Artifacts

When you ask for...You get...
Auth designRecommended flow, principal, scopes, and governance controls
Security reviewFindings on scopes, secrets, endpoints, and ownership gaps
Troubleshooting helpRoot-cause path for token, endpoint, or permission issues
Environment strategyGuidance for promoting auth config safely across environments

Reference Files

FileRead it when
references/metadata-examples.mdYou are writing or reviewing actual metadata — connectedApp-meta.xml, the four-file ECA set, a Named Credential + External Credential pair, package.xml, retrieve/deploy caveats, or the post-deploy verification SOQL
references/gotchas.mdSomething deployed cleanly and behaved wrong: missing secret after retrieve, admin-approved with no grantee, refresh tokens that never expire, ipRelaxation doing nothing, an ECA migration that broke on enums, an empty OauthToken query
references/well-architected.mdYou need the Security / Operational Excellence / Reliability framing for a review, or the exact official source behind a claim in this skill
references/llm-anti-patterns.mdYou are checking AI-generated auth guidance — username-password flows, hardcoded secrets, full scope, legacy Named Credentials, or a walkthrough that opens with "New Connected App"
templates/auth-integration-template.mdBefore any new integration is built, to capture direction, flow, principal, key custody, rotation owner and IP controls in one place
scripts/check_connected_auth.pyAfter writing metadata and before deploying — --manifest-dir <dir> for the XML checks, or pass file paths for the secret/endpoint text scan

Related Skills

  • admin/change-management-and-deployment: Use when the main issue is how auth metadata is promoted or rolled back. NOT for flow selection itself.
  • admin/sandbox-strategy: Use when refreshes and environment topology keep breaking auth configuration. NOT for connected-app governance design.
  • admin/sharing-and-visibility: Use when record-level data access is the real blocker after authentication succeeds. NOT for OAuth and Named Credential decisions.
  • admin/connected-app-troubleshooting: Use when an OAuth error code is already on screen and you need the diagnosis path. NOT for choosing the artefact or writing the metadata.
  • integration/oauth-flows-and-connected-apps: Use for the deep comparison between flows, including device flow and token lifecycle mechanics. NOT for the admin's deployable shape and policies.
  • integration/named-credentials-setup: Use for External Credential principal types and the per-user vs per-org setup steps. NOT for deciding whether the outbound pair is the right artefact.
  • security/connected-app-security-policies: Use when hardening and secret rotation is the programme of work. NOT for the initial artefact and flow decision.
  • security/oauth-token-management: Use when tokens are issued, refreshed, rotated, revoked, or introspected in anger. NOT for connected-app metadata authoring.
  • security/oauth-redirect-and-domain-strategy: Use when callback URLs, My Domain, or Enhanced Domains drive the design. NOT for scopes, principals, or IP policy.
  • security/sso-configuration: Use when the goal is user single sign-on rather than API integration auth. NOT for machine-to-machine flows.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Connected Apps And Auth」では何ができますか?

Use when designing, reviewing, or troubleshooting Salesforce connected apps, External Client Apps, Named Credentials, External Credentials, and OAuth-based integration access. Triggers: 'connected app', 'OAuth flow', 'client credentials', 'JWT bearer', 'Named Credential', 'External Credential', 'integration user', 'IP restrictions', 'connectedApp-meta.xml', 'ExternalClientApplication', 'ExtlClntAppOauthSettings', 'isAdminApproved', 'refreshTokenPolicy', 'ipRelaxation', 'consumer key', 'consumer secret', 'permittedUsersPolicyType'. NOT for OAuth error codes you are already seeing — use admin...

TypingMindでConnected Apps And Authを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Connected Apps And Authはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにConnected Apps And Authをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/PranavNagrecha/AwesomeSalesforceSkills/tree/main/skills/admin/connected-apps-and-authを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Connected Apps And Authを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Connected Apps And Authで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもConnected Apps And Authを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Connected Apps And Auth」は無料ですか?

PranavNagrechaがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇