How do I configure sales force api credentials to call Factor APIs?

Last updated: September 16, 2025

Overview

This article explains how to set up Named Credentials in Salesforce for OAuth2 authentication using the Client Credentials flow, and how to utilise these credentials in Integration Procedures for secure API integrations.

Prerequisites

  • System Administrator or equivalent permissions

  • Valid OAuth2 client credentials (Client ID and Client Secret), and a scope provided from Factor

  • OmniStudio or Vlocity package installed (for Integration Procedures)

Part 1: Understanding External Credential Requirements

Important: In scenarios where Named Credentials must use External Credentials, the traditional direct Named Credential configuration is not sufficient. This guide focuses on the External Credential approach as the required method.


Part 2: Creating an External Credential

Step 1: Create External Credential

  1. Navigate to Named Credentials in Setup

  2. Click External Credentials

  3. Click New

  4. Configure:

    • Master Label: Descriptive name (e.g., "Factor APIs")

    • Developer Name: Auto-populated (e.g., "factor_api") . Note this value, you'll need it for step 6.

    • Authentication Protocol: OAuth 2.0

    • Authentication Flow Type: Client Credentials with Client Secret Flow

    • Identity Provider URL https://idp.usefactor.io/oauth/token

    • Check Pass client credentials in request body

  5. Click Save

Step 2: Add Principals

  1. After saving, scroll to New in the Principals section

  2. Create the Client ID principal:

    • Parameter Nameclient_id

    • Parameter Value: Enter your OAuth2 client ID

    • Parameter Type: Text

  3. Click Save, then add another principal

  4. Create the Client Secret principal:

    • Parameter Nameclient_secret

    • Parameter Value: Enter your OAuth2 client secret

    • Parameter Type: Password

When completed, your eternal credential should look like this:

image.png

Step 3: Create Named Credential with External Credential

  1. Create a new Named Credential

  2. Configure basic settings:

    • Label: Descriptive name

    • Name: Auto-populated

    • URL: Base URL of the factor APIs https://forecast.usefactor.io

  3. In Authentication section:

    • External Credential: Select your created External Credential

  4. Call out Options

    • Generate Authorization Header: Check this box

    • Allow Merge Fields in HTTP Header: Check this box

    • Allow Merge Fields in HTTP Body: Check this box

When completed your Named Credential should look like this:

image.png

Part 3: Configure and assign permissions

Step 4: Configure Permission Set for External Credential Access

  1. Navigate to Permission Sets in Setup

  2. Create a new Permission Set or modify an existing one:

    • Label: Factor External Credential Access (or descriptive name)

    • API Name: Auto-populated

    • License: None (for maximum flexibility)

  3. After saving, click External Credential Principal Access

  4. Click Edit

  5. Select your External Credential and move it to Enabled External Credential Principal Access

  6. Save the Permission Set.

  7. After save ensure the following have not been set by default:

    1. Session Activation Required

    2. Licenses required

Step 4: Assign Permission Set to Users

  1. From the Permission Set detail page, click Manage Assignments

  2. Click Add Assignments

  3. Select the users who need access to the External Credential

  4. Click Assign and then Done

Alternative: Profile-Based Access

  1. Navigate to Profiles in Setup

  2. Select the appropriate profile

  3. Click External Credential Principal Access

  4. Click Edit

  5. Select your External Credential and move it to Enabled External Credential Principal Access

  6. Save the changes


Part 4: Update remote Sites

Step 6: Update the Remote Site configuration settings

  1. Navigate to remote site settings

  2. Add the following remote sites:

    1. https://forecast.usefactor.io

    2. https://forecast.staging.usefacgtor.io

    3. https://idp.usefactor.io

    4. https://idp.staging.usefactor.io


Part 5: Update integration procedure

Step 7: Use the Credentials in your Integration Procedures

  1. Navigate to your integration procedure

  2. Select your HTTP Request module

    1. Request URL: e.g. /forecast/forecastRequests/ (do NOT enter the full host and domain)

    2. Named credential: input the value you configured for your external credential in step 3.1 e.g. factor_api

  3. Save the integration procedure

  4. Before activating the procedure, select preview to test

    1. the credential isAccessible by the user

    2. The http module in your integration procedure can access the factor end point