> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Salesforce Service Cloud with OAuth 2.0 (Client Credentials) – StackOne Hub

> Link a Salesforce Service Cloud account in the StackOne Hub using OAuth 2.0 (Client Credentials). End-user guide to authorize the integration and start using Salesforce Service Cloud actions.

> [!WARNING]
>
> You need an administrator profile in your Salesforce org to create an External Client App and set its Run As user.

Select Actions to adjust the guideSome actions may require additional configuration in the provider to be accessible. Choose the actions you need and the guide will be updated.

Select all
Clear

ActionScope(s)

Loading actions...No actions match your search.

Dynamic Guide URL

Copy URL

Scopes Selected

<pre role="textbox" aria-readonly="true" tabIndex="0" />

Separator

Copy scopes

## Create an External Client App

The client credentials flow signs in as a Salesforce user you choose, without a browser sign-in. It needs its own External Client App with that flow turned on.

**1. Start the app**

Sign in to your [Salesforce org](https://login.salesforce.com), then click the gear icon and select **Setup**.

<ul>
  <li>In the **Quick Find** box, enter `External Client` and select **External Client App Manager**.</li>
  <li>Click **New External Client App**.</li>
</ul>

![The Setup sidebar filtered to External Client Apps with External Client App Manager highlighted](https://mintcdn.com/stackone-60/gqlTfrcQkcpjkJWx/connectors/salesforceservicecloud/images/oauth2_client_credentials-config-app-manager.png?fit=max\&auto=format\&n=gqlTfrcQkcpjkJWx\&q=85\&s=49160f635659297f45f5343eed182944)

**2. Fill in the basic information**

Complete the **Basic Information** section.

<ul>
  <li>**External Client App Name**: `StackOne Integration`</li>
  <li>**API Name**: filled in from the app name</li>
  <li>**Contact Email**: Your email address</li>
  <li>**Distribution State**: **Local**</li>
</ul>

![The Basic Information section with the app name, API name, contact email and distribution state fields highlighted](https://mintcdn.com/stackone-60/gqlTfrcQkcpjkJWx/connectors/salesforceservicecloud/images/oauth2_client_credentials-config-basic-information.png?fit=max\&auto=format\&n=gqlTfrcQkcpjkJWx\&q=85\&s=4e45e4a112ed3e5b90ea85b0a681369b)

**3. Add the API scope**

Enables actions: Create Business Hours, Create Case, Create Case Comment, Create Email Message, Create Entitlement, Create Knowledge Article, Create Pricebook, Create Record Type, Create Service Contract, Create Social Post, Create Work Order, Delete Case, Delete Case Comment, Delete Entitlement, Delete Knowledge Article, Delete Service Contract, Delete Work Order, Get Case, Get Case Comment, Get Entitlement, Get Knowledge Article, Get Service Contract, Get Work Order, List Activities, List Available Record Types, List Business Hours, List Case Comments, List Cases, List Contacts, List Email Messages, List Email Templates, List Entitlements, List Knowledge Articles, List Outbound Social Accounts, List Pricebooks, List Record Types, List SLA Processes, List Service Contracts, List Social Personas, List Social Posts, List Users, List Work Orders, Publish Knowledge Article, Search Cases, Search Knowledge Articles, Search Work Orders, Update Case, Update Case Comment, Update Entitlement, Update Knowledge Article, Update Service Contract, Update Work Order

Expand **API (Enable OAuth Settings)** and select **Enable OAuth**.

<ul>
  <li>**Callback URL**: `https://login.salesforce.com/services/oauth2/callback`. The form requires a value, but the client credentials flow never redirects to it.</li>
  <li>Under **Available OAuth Scopes**, select each scope listed and click the arrow to move it to **Selected OAuth Scopes**.</li>
</ul>

![The API (Enable OAuth Settings) section with Enable OAuth, the Callback URL field and the selected api scope highlighted](https://mintcdn.com/stackone-60/gqlTfrcQkcpjkJWx/connectors/salesforceservicecloud/images/oauth2_client_credentials-config-oauth-settings.png?fit=max\&auto=format\&n=gqlTfrcQkcpjkJWx\&q=85\&s=e605022d416220821486f97c69739a7a)

<ul>
  <li>
    api
  </li>
</ul>

**4. Enable the client credentials flow**

Under **Flow Enablement**, select **Enable Client Credentials Flow**.

<ul>
  <li>Click **OK** to confirm.</li>
  <li>Click **Create**.</li>
</ul>

![The Flow Enablement section with Enable Client Credentials Flow selected and the Create button highlighted](https://mintcdn.com/stackone-60/gqlTfrcQkcpjkJWx/connectors/salesforceservicecloud/images/oauth2_client_credentials-config-flow-enablement.png?fit=max\&auto=format\&n=gqlTfrcQkcpjkJWx\&q=85\&s=65766bc2c3f48679da61023a761c7465)

**5. Set the Run As user**

On the new app, open the **Policies** tab, click **Edit**, and expand **OAuth Policies**.

<ul>
  <li>Under **OAuth Flows and External Client App Enhancements**, select **Enable Client Credentials Flow**.</li>
  <li>**Run As (Username)**: the username of the Salesforce user the connection acts as. Every action runs with this user's permissions.</li>
  <li>**IP Relaxation**: **Relax IP restrictions**</li>
  <li>Click **Save**.</li>
</ul>

![The OAuth Policies section with Enable Client Credentials Flow selected and the Run As (Username) field highlighted](https://mintcdn.com/stackone-60/gqlTfrcQkcpjkJWx/connectors/salesforceservicecloud/images/oauth2_client_credentials-config-run-as.png?fit=max\&auto=format\&n=gqlTfrcQkcpjkJWx\&q=85\&s=a859a1467a1db25aa5f04c06cb651896)

**6. Copy the consumer key and secret**

Open the **Settings** tab, expand **OAuth Settings**, and click **Consumer Key and Secret**.

<ul>
  <li>Enter the verification code Salesforce emails you.</li>
  <li>Copy the **Consumer Key** across.</li>
  <li>Copy the **Consumer Secret** across.</li>
</ul>

![The OAuth Settings section with the Consumer Key and Secret button highlighted](https://mintcdn.com/stackone-60/gqlTfrcQkcpjkJWx/connectors/salesforceservicecloud/images/oauth2_client_credentials-config-consumer-key.png?fit=max\&auto=format\&n=gqlTfrcQkcpjkJWx\&q=85\&s=6be35d9e22df373967afb2db6ef616df)

## Find your My Domain

Your My Domain is your org's own Salesforce host. The client credentials flow only accepts a token request sent to it.

<ul>
  <li>In Setup, enter `My Domain` in the **Quick Find** box and select **My Domain**.</li>
  <li>Copy the **Current My Domain URL** across, leaving out the protocol.</li>
  <li>Format: `{name}.my.salesforce.com`, or `{name}--{sandbox}.sandbox.my.salesforce.com` for a sandbox</li>
  <li>Example: `acme.my.salesforce.com`</li>
</ul>

![The My Domain Details section with the Current My Domain URL row highlighted](https://mintcdn.com/stackone-60/gqlTfrcQkcpjkJWx/connectors/salesforceservicecloud/images/oauth2_client_credentials-config-my-domain.png?fit=max\&auto=format\&n=gqlTfrcQkcpjkJWx\&q=85\&s=170880417baba2be80ff64cfeb09f9fd)

## Link the Account

**1. Connect**

<ul>
  <li>Click **Connect**.</li>
  <li>If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider's authorization flow.</li>
  <li>Once authorization is successful, you will see a confirmation popup.</li>
</ul>

**2. Use Actions**

Connect an AI platform to the linked account's actions. See [AI Platforms](https://docs.stackone.com/ai-platforms/overview.md).

Other ways to call actions are listed in [Protocols & SDKs](https://docs.stackone.com/connect/protocols-and-sdks.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.