> ## 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 Key Pair – StackOne Hub

> Link a Salesforce Service Cloud account in the StackOne Hub using Key Pair. 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 pre-authorize users for it.

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 a key pair

The key pair is a certificate you upload to the app and the matching private key. Create both with OpenSSL:

```
openssl req -x509 -newkey rsa:2048 -nodes -keyout private.key -out cert.crt -days 365 -subj "/CN=StackOne Integration"
```

<ul>
  <li>`cert.crt` is the certificate you upload to Salesforce.</li>
  <li>Copy the full contents of `private.key` across as the **Private Key (PEM)**, including the `BEGIN` and `END` lines.</li>
</ul>

## Create an External Client App

The app holds the certificate and decides which users can connect with it.

**1. Start the app**

Sign in to Salesforce for the environment you are connecting, then click the gear icon and select **Setup**.

<ul>
  <li>**Production** — [Salesforce production sign-in](https://login.salesforce.com)</li>
  <li>**Sandbox** — [Salesforce sandbox sign-in](https://test.salesforce.com)</li>
  <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 JWT bearer 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. Upload the certificate**

Under **Flow Enablement**, select **Enable JWT Bearer Flow**.

<ul>
  <li>Under **Certificate Upload**, click **Upload Files** and select `cert.crt`.</li>
  <li>Click **Create**.</li>
</ul>

![The Flow Enablement section with Enable JWT Bearer Flow selected, cert.crt attached under Certificate Upload, and the Create button highlighted](https://mintcdn.com/stackone-60/gqlTfrcQkcpjkJWx/connectors/salesforceservicecloud/images/oauth2_jwt_bearer-config-certificate-upload.png?fit=max\&auto=format\&n=gqlTfrcQkcpjkJWx\&q=85\&s=5886fc69e1725c2ca518c535e98a48af)

**5. Select the user's profile**

On the new app, open the **Policies** tab and click **Edit**. Under **App Policies**, give the connecting user access to the app.

<ul>
  <li>Under **Select Profiles**, move the user's profile from **Available Profiles** to **Selected Profiles**, or add one of the user's permission sets under **Select Permission Sets**.</li>
</ul>

![The Select Profiles section with System Administrator under Selected Profiles highlighted](https://mintcdn.com/stackone-60/gqlTfrcQkcpjkJWx/connectors/salesforceservicecloud/images/oauth2_jwt_bearer-config-profiles.png?fit=max\&auto=format\&n=gqlTfrcQkcpjkJWx\&q=85\&s=9f866997d55ab8450861e57bfe40e10a)

**6. Set the permitted users**

Expand **OAuth Policies**.

<ul>
  <li>**Permitted Users**: **Admin approved users are pre-authorized**</li>
  <li>Click **Save**.</li>
</ul>

![The OAuth Policies section with Permitted Users set to Admin approved users are pre-authorized and the Save button highlighted](https://mintcdn.com/stackone-60/gqlTfrcQkcpjkJWx/connectors/salesforceservicecloud/images/oauth2_jwt_bearer-config-permitted-users.png?fit=max\&auto=format\&n=gqlTfrcQkcpjkJWx\&q=85\&s=a732e139bf5321fe370c0060c771d3d4)

**7. 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 username

The username is the Salesforce user the connection acts as. Every action runs with this user's permissions, and the user's profile or permission set must be the one you pre-authorized on the app.

<ul>
  <li>Copy the **Username** across.</li>
  <li>Format: an email-style login such as `integration.user@acme.com`</li>
</ul>

## 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.