This guide explains how to configure a Salesforce External Client App and connect it to Leapwork Play.
The setup has two parts:
-
A Salesforce administrator creates and configures the External Client App.
-
A team administrator saves the Salesforce Consumer Key and Consumer Secret in Play and creates a connection.
Prerequisites
-
Salesforce administrator access to the Salesforce org.
-
Team administrator access in Leapwork Play.
-
The Play environment's Salesforce callback URL.
-
The Salesforce External Client App must use OAuth.
1. Create the Salesforce External Client App
In Salesforce:
-
Open Setup.
-
In Quick Find, search for External Client Apps.
-
Open External Client App Manager.
-
Select New External Client App.
-
In Basic Information, enter:
-
External Client App Name: a recognizable name, such as
Leapwork Play. -
API Name: accept the generated value unless your organization has a naming standard.
-
Contact Email: an administrator or integration owner.
-
Description: explain that the app is used by Leapwork Play to authenticate and automate Salesforce.
-
-
Expand API (Enable OAuth Settings).
-
Enable OAuth.
-
Enter the callback URL copied from Play (Get this from Teams section salesforce auth settings new auth settings).
-
Select the following OAuth scopes:
-
Manage user data via Web browsers (
web). -
Perform requests at any time (
refresh_token/offline_access, depending on the Salesforce UI label).
-
-
Save the External Client App.
The connector uses the web scope for the Salesforce browser session and the refresh-token scope to keep the connection active after the access token expires. Do not add broader scopes unless the Salesforce automation requires them.
2. Configure app access policies
The default Salesforce OAuth approval screen may display a security warning. This is a standard Salesforce message and does not indicate a Leapwork error.
To restrict access to approved users:
-
Open the External Client App in Salesforce.
-
Open the Policies tab.
-
Edit OAuth Policies.
-
Choose Admin approved users are pre-authorized if your organization requires administrator approval.
-
Assign the required profiles or permission sets to the app.
If users are allowed to self-authorize, they can approve access from the Salesforce OAuth screen during the connection flow.
3. Copy the Salesforce credentials
From the External Client App's consumer details, copy:
-
Consumer Key: this is the Salesforce OAuth client ID.
-
Consumer Secret: this is the Salesforce OAuth client secret.
4. Save the OAuth app in Play
In Play:
-
Open the required team.
-
Open Team Settings.
-
Open the Salesforce section.
-
In Auth Settings, choose Add OAuth App.
-
Enter an app name.
-
Paste the Salesforce Consumer Key into Client ID.
-
Paste the Salesforce Consumer Secret into Client Secret.
-
Save the OAuth app.
The Client ID is stored with the team's OAuth app record. The Client Secret is saved through the shared secret store, and only a secret reference is stored with the OAuth app record. The secret is not displayed again after it is saved.
5. Create a Salesforce connection
-
In the Salesforce section of Team Settings, select Add Connection.
-
Enter a connection name.
-
Select the OAuth app that was saved in Auth Settings.
-
Select the Salesforce login type:
-
Production uses
https://login.salesforce.com. -
Sandbox uses
https://test.salesforce.com. -
Custom uses the Salesforce login URL entered in the form.
-
-
Select Continue to Salesforce.
-
Sign in to Salesforce.
-
Review the requested permissions.
-
Select Allow.
Use the Salesforce connection in a test case
After the connection is created, assign it to a test case through the test case metadata.
-
Open the test case that should use Salesforce.
-
In the test case metadata panel, find Connector.
-
Open the dropdown and select the saved connection. It appears as:
Salesforce - <connection name> -
Run the test case.
The connection is team-scoped. A connection created for one team cannot be selected or used by a test case belonging to another team.