Configuring OAuth 2.0 Authentication in Salesforce

Configuring OAuth 2.0 Authentication in Salesforce

OAuth 2.0 (Open Authorization 2.0) is an open standard for access delegation, commonly used to grant third-party applications limited access to a user’s resources without exposing their credentials. It allows secure access to a resource on behalf of a user while maintaining data protection and minimizing security risks. 

OAuth 2.0 requires a browser for one-time user consent. The user must authorize the application’s request to access their data through a browser. Once consent is granted, the application can use the refresh token to maintain access without requiring further browser-based authentication. 

Create a Connected App in Salesforce for OAuth 

Create a Connected App to enable OAuth-based integration and allow external applications to securely access Salesforce data: 

1. Log in to Salesforce and navigate to Setup

2. In the Quick Find search box, type App, then select App Manager

Create a custom OAuth App in Salesforce
 
3. Select New Connected App

4. In the dialog that appears, select Create a Connected App, then select Continue

Create a Connected App

4. In the Basic Information section, provide the following details: 
  1. App Name: A unique identifier for your application, displayed to users during authentication. 
  2. API Name: An automatically generated value based on the app name. 
  3. Contact Email: A support email address for inquiries and notifications. 
Salesforce App Manager

5. In the API (Enable OAuth Settings) section, select Enable OAuth Settings, then enter a Callback URL
  1. For desktop apps, enter http://localhost:33333 or another localhost port. 
  2. For web apps, enter a valid URL where users will be redirected after authorizing the app. 
6. In the Selected OAuth Scopes section, select the necessary permissions for your application. Commonly used scopes include: 
  1. refresh_token and offline_access: This scope allows the application to refresh access tokens without requiring user reauthentication. 
  2. api: This scope grants access to Salesforce APIs for data retrieval and manipulation. 
  3. full: This scope provides full access to Salesforce data, including read and write permissions. 
Add the required scopes by selecting Add

7. Select Save to create the Connected App. 

View the OAuth client credentials 

1. Navigate to the App Manager, locate your app, and click View

2. Next to Consumer Key and Secret select Manage Consumer Details

A page will open displaying your Consumer Key (Client ID) and Consumer Secret

Salesforce - Manage Consumer Details
    • Related Articles

    • How to Set Up Devart ODBC Drivers for OAuth Authorization in Cloud Services

      To connect to cloud databases like HubSpot, Zoho, or Salesforce using OAuth authorization, follow these general steps: 1. Register an Application Start by registering your application in the cloud service you're connecting to (e.g., HubSpot, Zoho, or ...
    • Working with Salesforce Attachments

      This article is for SSIS Data Flow Components for Salesforce. SSIS Data Flow Components for Salesforce can be used to download and upload Salesforce attachments. To work with documents (binary files), the ContentVersion object is required. The binary ...
    • Guide: Configuring ODBC Driver in Azure Data Factory

      This guide walks you through the steps of setting up and using an ODBC driver in Azure Data Factory (ADF) for seamless data integration. By following this guide, you will be able to configure an ODBC driver, create a Linked Service, and define an ...
    • Cannot Open Table ‘Case’ and ‘Order’ in SSMS with ODBC Driver for Salesforce

      When working with SQL Server Management Studio (SSMS) and the Devart ODBC Driver for Salesforce, you may encounter difficulties accessing certain tables such as Case or Order. Important Note on SSMS Behavior Queries in SSMS are first processed by SQL ...
    • Setting up a Connection to ODBC in Delphi Using Devart ODBC Driver

      This guide will walk you through the steps of setting up a connection to an ODBC driver in Delphi. We'll use ODBC Driver for Salesforce as an example. Prerequisites: Devart ODBC Driver for Salesforce installed on your machine. A Salesforce account ...