A Step-By-Step Guide to Setting Up a Salesforce Connected App for Easy OAuth Integration

Welcome to this guide on setting up a Salesforce Connected App for seamless OAuth integration. In this step-by-step tutorial, you’ll learn the basics of setting up a Connected App in Salesforce and accessing it through Postman using the API. Let’s dive deep into OAuth, starting with configuring a Connected App.

Step 1: Create a New Connected App

Navigate to App Manager: Begin by accessing the App Manager on Salesforce.

Enable API Access: To facilitate access from external applications through the API, create a new Connected App and name it "App One".

Configure the App: Provide an email for the app and enable OAuth settings. Although some OAuth flows necessitate a callback URL (which we’ll discuss in subsequent guides), for now, input a dummy value like "www.salesforce.com".

Step 2: Set OAuth Scopes

Scopes define the capabilities accessible through the API. For this tutorial:

Manage User Data: Assign the scope that allows managing user data through the API.

Save and Wait: Save your settings and wait for approximately 10 minutes for the process to complete.

Step 3: Retrieve Consumer Details

Once the process is complete, you will need two essential pieces of non-public information: Consumer Key and Consumer Secret. Press the respective button to authenticate and retrieve these details for "App One".

Step 4: Authenticate Using Postman

Initiate a POST Call: On Postman, create a post call to the OAuth server at “login.salesforce.com/services/oauth2/token”.

Set Parameters: Insert parameters in the body, including grant type (password), client ID (Consumer Key), and Client Secret.

Insert User Credentials: Add a username and password to the parameters, then initiate a post against the OAuth endpoint to authenticate.

Step 5: Access Token and Queries

Once authenticated successfully:

Obtain Access Token: You'll receive an access token necessary for making API calls.

Insert Token: In Postman, on your query request, insert the access token in the header’s authorization line preceded by the word 'Bearer'.

Run Queries: After inserting the token, initiate the request to run queries, retrieving data successfully.

Step 6: Endpoint Versioning and Additional Steps

You can now access your Connected App endpoint version (e.g., version 58) to retrieve data. This basic setup won't encompass all additional flow elements or callbacks but serves as a foundational step for OAuth integration with Postman and Salesforce.

Conclusion and Next Steps

You have now successfully set up a Salesforce Connected App and authenticated it using OAuth for API access through Postman. While this guide covers the basics, subsequent tutorials will introduce additional OAuth flows and functionalities to enhance your app’s capabilities.

Stay Tuned

Embark on your Salesforce API journey with confidence! For more insights and tips, stay tuned here on www.SteveTechArc.com and to the @SteveTechArc YouTube channel. Subscribe and enhance your understanding of Salesforce and how you can integrate it with other systems.

Helping change the world by sharing integration info with fellow Architects and those on their Architect Journey!

Transcript aided by AI

STA 3.11

Previous
Previous

Understanding OAuth Web Server Flow: A Beer Garden Analogy

Next
Next

Understanding Salesforce Security: Navigating OAuth Flows with a Beer Garden Analogy