Skip to main content

Get Started with Authentication

Learning Objectives

After completing this unit, you’ll be able to:

  • Describe how authentication works.
  • Gather what you need to get started with OAuth and the Pardot API.
  • Create a connected app.

How Does Authentication Work with the Pardot API?

The first step to working with Pardot APIs is authentication. Authentication is the process of proving a user’s identity when they try to access resources on a server. Authentication protects your data, and also makes sure that the server can associate your requests to your data. Before you can access resources via the Pardot API, you must first prove your identity using Salesforce OAuth. 

OAuth is an open protocol that uses an authentication server to communicate with the API server and exchange tokens to authenticate users. Salesforce has several OAuth flows to meet your unique security and integration needs. In this module, we use the web server OAuth flow. This flow is ideal for when you don’t want to store the end user’s credentials in your system. 

Note

Note: To learn more about your options and how to choose the best OAuth flow for your integration, check out Authorize Apps with OAuth in Salesforce Help.

Next, we cover the steps to set up Salesforce OAuth with the Pardot API.

  • Gather your resources.
  • Create a connected app.
  • Set up authentication.
  • Implement your OAuth flow.

What You Need to Get Started

Before you begin, make sure to have a few things ready.

  • A Salesforce admin to create a connected app and gather information.
  • A Salesforce user with SSO enabled for Pardot.
  • A configured Pardot Business Unit.
  • A chosen OAuth flow that works best for your case. This module uses the web server OAuth flow.

After you have everything you need, move on to the next step, where you create a connected app. 

In this module, we assume you are a Salesforce admin with the proper permissions to take these actions. If you’re not an admin, that’s OK. Read along to learn how your admin would take the steps in a production org. Don’t try to follow these steps in your Trailhead Playground. Pardot isn’t available in the Trailhead Playground.

Create a Connected App

The first step in authentication is creating a connected app. A connected app is a framework that enables an external application to integrate with Salesforce using APIs and standard protocols like OAuth. Connected apps use these protocols to authenticate, authorize, and provide single sign-on (SSO) for external apps. To put it simply, a connected app represents an integration.

To set up a connected app, have a Salesforce admin follow these steps.

  1. From Salesforce Setup, in the Quick Find box, enter App Manager, and then select App Manager.
  2. Click New Connected App.
  3. Name the connected app, and enter contact details for the app owner.
  4. In the API section, select Enable OAuth Flows.
  5. Enter a Callback URL. The callback URL is used to redirect users after authentication in browser-based flows. In this example, we use https://my.example.com/myapp. If you’re using a browser-based flow (such as Web Server Flow or User Agent Flow), the URL must match the URL you pass as a callback to OAuth endpoints. If you aren’t using a browser-based flow, the URL entered isn’t used.
  6. Under Selected OAuth Scopes, add Access Pardot services, which give the app access to Pardot. For more complex scenarios, such as using refresh tokens, select other scopes as well.
  7. Save the connected app.

This just scratches the surface of connected apps, so if you want to learn more check out the connected app resources listed in the Resources section. 

Now that you know about authentication and have your connected app, let’s move on to implementing Salesforce OAuth and authenticating to the Pardot API. 

Resources

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities