Creating a Custom OAuth App
If you do not have access to the user name and password or do not wish to require them, you can use OAuth authentication. Salesforce Pardot uses the OAuth authentication standard, which requires the authenticating user to interact with Salesforce Pardot via the browser. The driver facilitates the OAuth exchange in various ways, as described in this section.
Create an OAuth App
To obtain the OAuth client credentials, consumer key, and consumer secret:
- Log in to salesforce.com.
- From Setup, enter Apps in the Quick Find box and then click the link to create an app. In the Connected Apps section of the resulting page, click New.
- Enter a name to be displayed to users when they log in to grant permissions to your app, along with a contact Email address.
- Click Enable OAuth Settings and enter a value in the Callback URL box. If you are creating a desktop application, set the Callback URL to http://localhost:33333 or to a different port number of your choice. If you are creating a web application, set the Callback URL to a page on your web application you want the user to be returned to after they have authorized your application.
- Select the scope of permissions that your application should request from the user. At a minimum, OAuth scopes must include "pardot_api", "api", and "refresh_token" scopes. Adding "refresh_token" causes the API to returen a refresh token in the OAuth request, which the driver then uses to automatically refresh the access token when it expires.
Use "full" to include all scopes. Otherwise, only the username-password OAuth flow can be used with the Pardot API.
- Click your application name to open a page with information about your application. The OAuth client credentials, consumer key, and consumer secret are displayed.
Create an OAuthJWT App
To obtain the OAuthJWT consumer key:- Log in to salesforce.com.
- From Setup, enter Apps in the Quick Find field and then click the link to create an app. In the Connected Apps section of the resulting page, click New.
- Enter a name to be displayed to users when they log in to grant permissions to your app, along with a contact Email address.
- Click Enable OAuth Settings and enter a value in the Callback URL box. Set this value only to create the Connected App. It is not needed for this type of authentication. The Callback URL is in the format:
http://localhost:8019/src/oauthCallback.rst
- Enable Use digital signatures.
- Upload your certificate.
- Select the scope of permissions that your applicationshould request from the user. At a minium, the selected OAuth scopes must include'"pardot_api" and "api" scopes. Select "full" to include all scopes.
- Click your application name to open a page with information about your app. The OAuth consumer key is displayed.