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

# Salesforce OAuth 2.0 connector profile – StackOne setup guide

> Set up the OAuth 2.0 connector profile for Salesforce in StackOne. One-time admin setup required before your users can link Salesforce accounts via Hub.

<Warning>Ensure you have Admin privileges for your Salesforce account.</Warning>

<section data-guide-section data-guide-scopes="">
  <h2>Creating a Connected App</h2>

  <p>To connect Salesforce with StackOne, you need to create a Connected App in your Salesforce org to obtain OAuth credentials.</p>

  <Steps>
    <Step title="Sign in to Salesforce Setup">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Sign in to your <a href="https://login.salesforce.com" target="_blank" rel="noopener noreferrer">Salesforce account</a> and click the <strong>Setup</strong> ⚙️ icon in the top-right menu.</p>
      </div>
    </Step>

    <Step title="Navigate to App Manager">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>In the left navigation under <strong>Platform Tools</strong>, expand <strong>Apps</strong> and click <strong>App Manager</strong>.</p>

        <ul>
          <li>Click the <strong>New External Client App</strong> button in the top-right corner</li>
        </ul>
      </div>
    </Step>

    <Step title="Enter Application Information">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>In the <strong>Basic Information</strong> section, enter the following details.</p>

        <ul>
          <li><strong>External Client App Name</strong>: StackOne Integration (or your preferred name)</li>
          <li><strong>API Name</strong>: Will auto-populate based on the app name</li>
          <li><strong>Contact Email</strong>: Your admin email address</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Configure OAuth Settings</h2>

  <p>Enable and configure OAuth settings for API access.</p>

  <Steps>
    <Step title="Enable OAuth Settings">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Check the <strong>Enable OAuth Settings</strong> checkbox to expand the OAuth configuration section.</p>

        <ul>
          <li>In <strong>Callback URL</strong>, enter: `https://api.stackone.com/connect/oauth2/salesforce/callback`</li>
        </ul>
      </div>
    </Step>

    <Step title="Select OAuth Scopes">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Under <strong>Selected OAuth Scopes</strong>, add the following scopes.</p>

        <ul>
          <li><strong>Manage user data via APIs</strong> (api)</li>
          <li><strong>Perform requests at any time</strong> (refresh\_token, offline\_access)</li>
          <li>In <strong>Security</strong>, keep <strong>Require secret for Web Server Flow</strong> and <strong>Require secret for Refresh Token Flow</strong> checked (default)</li>
          <li>In <strong>Security</strong>, uncheck <strong>Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows</strong> (otherwise Salesforce returns `missing required code challenge`)</li>
        </ul>
      </div>
    </Step>

    <Step title="Save the Connected App">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Click <strong>Create</strong> at the bottom of the page.</p>

        <ul>
          <li>You will be redirected to the Connected App detail page</li>
          <li>Note: It may take up to 10-20 minutes for the app to become active</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Retrieve Consumer Credentials</h2>

  <p>Obtain the Client ID and Client Secret for StackOne configuration.</p>

  <Steps>
    <Step title="Access Consumer Details">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>In the left navigation under <strong>Platform Tools</strong>, expand <strong>Apps</strong> then <strong>External Client Apps</strong> and click <strong>External Client App Manager</strong> or <strong>OAuth Usage</strong>.</p>

        <ul>
          <li>Open the app you created (e.g., StackOne Integration)</li>
          <li>Go to <strong>Settings</strong> > <strong>OAuth Settings</strong></li>
          <li>Click <strong>Consumer Key and Secret</strong></li>
          <li>You may be prompted to verify your identity via email or authenticator</li>
        </ul>
      </div>
    </Step>

    <Step title="Copy Credentials">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Copy the <strong>Consumer Key</strong> (Client ID) and <strong>Consumer Secret</strong> (Client Secret).</p>

        <ul>
          <li>Store these credentials securely for use later</li>
          <li>The Consumer Key is your <strong>Client ID</strong></li>
          <li>The Consumer Secret is your <strong>Client Secret</strong></li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Selecting an Environment</h2>

  <p>Choose the appropriate environment based on your Salesforce org type.</p>

  <Steps>
    <Step title="Choose Your Environment">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>Select the environment that matches your Salesforce org.</p>

        <ul>
          <li><strong>Production</strong>: Select this for your live Salesforce org with real data</li>
          <li><strong>Sandbox</strong>: Select this for testing environments or developer orgs</li>
          <li>Sandbox environments are typically used for development and testing before deploying to production</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

<section data-guide-section data-guide-scopes="">
  <h2>Custom OAuth Scopes</h2>

  <p>If you need to customize the OAuth scopes, keep the following in mind.</p>

  <Steps>
    <Step title="Required Scopes for Token Refresh">
      <div data-guide-step data-guide-scopes="" data-guide-display-scopes-list="">
        <p>When providing custom scopes, you must include at least one of `refresh_token` or `offline_access` to ensure the connection can refresh its access token.</p>

        <ul>
          <li>If the <strong>OAuth Scopes</strong> field is left blank, the default scopes (`api refresh_token offline_access`) are used automatically</li>
          <li>If you specify custom scopes, always include <strong>refresh\_token</strong> or <strong>offline\_access</strong> (e.g., `api chatter_api content refresh_token offline_access`)</li>
          <li>Without a refresh scope, the connection will fail because Salesforce will not issue a refresh token</li>
          <li>Every custom scope you specify must also be added to the Connected App's <strong>Selected OAuth Scopes</strong>, otherwise Salesforce returns an OAuth Error</li>
        </ul>
      </div>
    </Step>
  </Steps>
</section>

## Creating the StackOne Connector Profile

To create the Connector Profile in StackOne for <strong>Salesforce</strong>:

<Steps>
  <Step title="Navigate to Connector Profiles">
    Login to StackOne and navigate to [Connector Profiles](https://app.stackone.com/connector_profiles)
  </Step>

  <Step title="Create New Connector Profile">
    <ul>
      <li>Click <strong>+ Connector Profile</strong></li>
      <li>Search for and select <strong>Salesforce</strong></li>
      <li>Select <strong>Type</strong> as <strong>OAuth 2.0</strong></li>

      <li>
        Fill out the fields using details retrieved from your provider:

        <ul style={{ marginLeft: '20px' }}>
          <li><strong>Client ID (Consumer Key)</strong></li>
          <li><strong>Client Secret (Consumer Secret)</strong></li>
          <li><strong>OAuth Scopes</strong> (Optional)</li>
        </ul>
      </li>

      <li>(Optional) Select <strong>Actions</strong> to be enabled for this Connector Profile</li>
      <li>Click <strong>Create profile</strong></li>
    </ul>
  </Step>
</Steps>

Congratulations! The new Connector Profile will now show up in your project ready to be used. You can now continue to <a href="/guides/accounts-section#linking-accounts">Link Accounts</a> for <strong>Salesforce</strong>.
