/ /
Salesforce OAuth ConnectionThis article explores the various Salesforce connection methods supported by DevRev, detailing the OAuth2 flows available.

Overview of Salesforce OAuth2 Integration

DevRev supports multiple OAuth2 authentication flows for Salesforce connections, ensuring flexibility and security across different integration scenarios. These authentication methods enable secure, authorized access to Salesforce data while maintaining compliance with enterprise security standards.

Supported OAuth2 Flows


1. Client Credentials OAuth2 Flow:

Use Case: Server-to-server integrations where no user interaction is required.

Required Credentials:

  • Client ID

  • Client Secret

Prerequisites:

  • Ensure you have appropriate Salesforce admin permissions to create and manage OAuth Apps

  • Connected App must be configured with proper OAuth settings

The Client Credentials flow is ideal for automated, system-level integrations between DevRev and Salesforce. This flow operates without user intervention.

Key Benefits:

  • No user login required

  • Suitable for automated processes

  • Enhanced security through client authentication

  • Ideal for production environments with minimal human intervention

Reference: Salesforce Client Credentials OAuth2 Documentation


2. Authorization Code OAuth2 Flow

Use Case: Interactive user authentication with enhanced security through refresh tokens.

Initial Setup Requirements:

  • Admin Approval Process: When OAuth is first initiated, a Salesforce Admin needs to accept/install the DevRev App in the organization

  • Organization-Wide Access: Once the DevRev App is installed and approved by an admin, all users within the Salesforce organization can easily make OAuth connections without requiring individual admin approval

  • One-Time Administrative Action: This initial approval is a one-time process per Salesforce organization

The Authorization Code flow provides the most secure method for user-based Salesforce integrations. This two-part process includes:

Web Server Flow

This flow enables secure user authentication through browser-based OAuth2 authorization, perfect for:

  • User-specific data access

  • Interactive applications

  • Web-based integrations

  • Applications requiring user consent

Reference: Salesforce Web Server Flow Documentation

Refresh Token Flow

Complementing the web server flow, the refresh token mechanism ensures:

  • Long-term access without repeated user authentication

  • Automatic token renewal

  • Enhanced user experience

  • Maintained security standards

Reference: Salesforce Refresh Token Flow Documentation


3. Username-Password OAuth2 Flow

Use Case: Direct authentication using Salesforce credentials for trusted applications.

Required Credentials:

  • Username

  • Password

  • Client ID

  • Client Secret

Prerequisites:

  • Ensure you have appropriate Salesforce admin permissions to create and manage OAuth Apps

  • User account must have API access enabled

  • Connected App must be properly configured

This flow allows DevRev to authenticate with Salesforce using a username and password combination along with the connected app credentials.

Key Benefits:

  • Simple implementation

  • Direct credential authentication

  • Suitable for trusted environments

  • Quick setup for development purposes

Reference: Salesforce Username-Password OAuth2 Documentation



How to Create Client ID and Client Secret in Salesforce

To obtain the Client ID and Client Secret required for these OAuth2 flows, you need to create a Connected App in Salesforce:

Step-by-Step Guide:

  1. Access Setup: Log into your Salesforce org and navigate to Setup

  2. Find App Manager: In the Quick Find box, type "App Manager" and select it

  3. Create New Connected App: Click "New Connected App"

  4. Configure Basic Information:

    • Connected App Name: Enter a name for your app

    • API Name: This will auto-populate

    • Contact Email: Enter your email address

  5. Enable OAuth Settings:

    • Check "Enable OAuth Settings"

    • Set the Callback URL (required even if not using web server flow)

    • Select OAuth Scopes needed for your integration

  6. Save and Retrieve Credentials:

    • After saving, you'll be redirected to the Connected App detail page

    • Your Consumer Key = Client ID

    • Click "Click to reveal" next to Consumer Secret = Client Secret

Useful Salesforce Documentation Links:

Was this article helpful?