how to get client id and client secret in salesforce

How to Acquire Client ID and Client Secret in Salesforce

By Andrew Martin
AD

When integrating Salesforce with other applications, you'll often need to use the OAuth 2.0 protocol, which requires a client ID and client secret. These credentials are essential for authorizing and authenticating your app's access to Salesforce data. Here's a comprehensive guide on how to secure and obtain your client ID and client secret in Salesforce.

Before diving in, ensure that you have the necessary permissions in your Salesforce org. Only users with 'Modify All Data' or 'Modify Everything' permissions can create connected apps and retrieve the client ID and client secret.

Creating a Connected App in Salesforce

Connected apps allow you to register your app with Salesforce and retrieve the client ID and client secret. Here's how to create one:

AD
the salesforce info sheet is shown in purple and blue colors, with information about how to
the salesforce info sheet is shown in purple and blue colors, with information about how to
Salesforce Tutorial
Salesforce Tutorial
Salesforce Interview Prep — One Sheet
Salesforce Interview Prep — One Sheet

1. From Setup, enter "Apps" in the Quick Find box, and then select Apps.

2. Click the New button, and then select Connected App.

the salesforce profiles poster is shown
the salesforce profiles poster is shown
Your 30-Day Sprint to Salesforce Admin Certification!
Your 30-Day Sprint to Salesforce Admin Certification!
10 Smart Ways Salesforce CTI Can Make Customer Support More Efficient
10 Smart Ways Salesforce CTI Can Make Customer Support More Efficient

Providing essential details

_start the app creation process by entering the relevant details:

- Connected App Label: A unique name for your connected app.

AD

- API Lifetime Policy: Choose 'Per user plus 15 minutes' or 'No api access' based on your requirement.

Salesforce Customer Data to Oracle Database: Automate Customer Sync
Salesforce Customer Data to Oracle Database: Automate Customer Sync
30 Ways on How to Get Clients for Your Business Online
30 Ways on How to Get Clients for Your Business Online
What is SFDC in Salesforce? Advanced Communities Edition
What is SFDC in Salesforce? Advanced Communities Edition
Where to Search Online Clients in 2026 | 8 Proven Places to Find High-Paying Freelance Clients Fast
Where to Search Online Clients in 2026 | 8 Proven Places to Find High-Paying Freelance Clients Fast
the word salesforce on top of a blue cloud in front of green and black background
the word salesforce on top of a blue cloud in front of green and black background
Salesforce Training
Salesforce Training

- Enable OAuth Settings: Check this box to enable OAuth 2.0 for your connected app.

- Callback URL: Enter the URL where you'd like users to be redirected after successful login via Salesforce.

AD

Setting 'Web App Properties' and 'Scopes

Once you've provided the basic details, scroll down to 'Web App Properties' section:

Essential Salesforce CRM Features in 2026
Essential Salesforce CRM Features in 2026
Client Management System Tip | Why Unique Client IDs Matter
Client Management System Tip | Why Unique Client IDs Matter
Salesforce Data 360: Turn Fragmented Data Into One Trusted Customer View
Salesforce Data 360: Turn Fragmented Data Into One Trusted Customer View

- Start URL & Endpoint URL: Enter the URLs where your app will redirect users for login and logout, respectively.

Scroll further down to the 'Scopes' section:

AD

- Select the access you need for your app. For full access, choose 'Full' in the 'Selected OAuth Scopes' dropdown.

Save your changes, and you'll see the Connected App details page with your client ID. The client secret is generated and displayed once, so make sure to copy it securely:

Finding your client ID and client secret

Your client ID is displayed on the Connected App details page:

- Client ID: A unique identifier for your connected app.

To find the client secret, click on the 'View Secret' button next to 'Consumer Key' (client ID) field. Ensure you save it securely, as it's only displayed once. If you've missed it, you'll need to delete and recreate the connected app to generate a new secret.

Managing Connected Apps in Salesforce

To view or manage your connected apps, navigate back to Setup > Apps > Connected Apps, and click on the desired app to make changes. Remember to inform Salesforce of any changes to your app by clicking 'Notify on Public Update' if needed.

In conclusion, obtaining your client ID and client secret is a crucial step in integrating your app with Salesforce using OAuth 2.0. Safely store these credentials and monitor the usage of your connected app to ensure data security at all times.

AD