Prerequisites

  • Salesforce account (personal or business)
  • Access to Salesforce Developer Portal

Step 1: Create Salesforce Developer Account

  1. Visit https://developer.salesforce.com/
  2. Click “Sign Up” or “Login” if you already have an account
  3. Sign in with your Salesforce account or create a new developer account
Salesforce Developer Login

Step 2: Create a New App

  1. Once logged in, go to “Setup Menu” (Gear Icon) and click “Setup”
  2. Search “App Manager” in the “Quick Find” search box
  3. In “App Manager”, choose “New External Client App”
Salesforce App Creation

Step 3: Fill Basic App Information

  1. Fill the necessary app details:
    • App name: Your application name (e.g., your brand name)
    • API Name: Your API Name (e.g similar to app name)
    • Distribution State: Local/Packaged (recommended to set as Local)
    • Other Information: Contact Mail, Contact Phone, Description, Info Url, Logo Image Url, and Icon Url
    Basic App Information

Step 4: Configure OAuth Settings

Klavis Salesforce MCP Server uses the following OAuth scopes: api,refresh_token,offline_access
  1. Redirect URIs: Add your callback URL:
    • https://api.klavis.ai/oauth/salesforce/callback
  2. Scopes: Move required scopes from “Available” to “Selected” Oauth scope menu:
    • api (required to manage user data via APIs)
    • refresh_token,offline_access (required to perform requests at any time)
  3. Click on “Create” app
OAuth Settings and Connection Configuration

Step 5: Get Consumer Key and Secret

After creating the app, follow these steps to get the credentials.
  1. From dashboard, go to “Setup Menu” (Gear Icon) and click “Setup”
  2. Search “External Client App Manager” in the “Quick Find” search box
  3. Click on App that you created. Navigate to Setting -> OAuth Settings
  4. Under “App Settings”, click on “Consumer Key and Secret”
  5. To access credentials, verify your identity using verification code sent to your connected mail.
  6. Copy Consumer Key and Consumer Secret from consumer details menu (keep it secure!)
Get Consumer Key and Secret

Step 6: Get Remaining credentials (Security Token, Username, Password, Instance Id)

  1. In user settings, “My Personal Information” -> “Advanced User Details”
  • Get Username from User Details section
  • Use Password that you set while creating the account.
  • Copy Instance ID from address bar or Login History -> Login Url tab
  1. Go to user setting, “My Personal Information” -> “Reset My Security Token”
  • Click Reset Security Token
  • Security Token is sent to you via mail (keep it secure!)
Get Security Token

(Optional) Step 7: White Labeling

White labeling allows you to customize the OAuth experience with your own branding instead of Klavis AI’s.
If you want to use your own Salesforce OAuth application with custom branding:
  1. Configure White Labeling: Go to https://www.klavis.ai/home/white-label
  2. Add Your Credentials: Enter your Salesforce Consumer Key and Consumer Secret from Step 5
  3. Set Redirect URI: Use https://api.klavis.ai/oauth/salesforce/callback or your custom callback URL
  4. Initiate OAuth: Use your Client Id when starting the OAuth flow:
    const authUrl = `https://api.klavis.ai/oauth/salesforce/authorize?instance_id=${instanceId}&client_id=${yourClientId}`;
    
For detailed white labeling implementation and code examples, see our OAuth & White Labeling guide.

Resources