Salesforce connections can be configured using OAuth. A single connector can be used to connect to both a Sandbox and Production Instance.
Setup in Salesforce
Before adding the Salesforce connector, we need to create the Connected app in Salesforce.
Find Salesforce Instance
- Log into the Salesforce environment as the user.
- Open Setup and search for Company Information.
- Locate the Instance value and save it for later.
Create a Connected App in Salesforce
- Log into the Salesforce environment as the user.
- Open Setup and search for App Manager.
- Select New Connected App.
- Connect App Name – Friendly name for the app.
- Contact Email – Email address for app issues.
- Enable OAuth Settings – Box must be selected.
- Callback URL – Enter the correct URL based on deployment/region.
- In SmartConnect.com navigate to Connections > Create Connection > Salesforce.
- Check the box for Use OAuth and copy the redirect URL displayed in the connection window.
- Selected OAuth Scopes – Choose these 5 scopes.
- Access the identity URL service (id, profile, email, address, phone)
- Manage user data via APIs (api)
- Manage user data via Web browsers (web)
- Perform requests at any time (refresh_token, offline_access)
- Access custom permissions (custom_permissions)
- Click Save on Connected App.
- When in the Connected App, click Manage Consumer Details.
- On the next screen save the Consumer Key and Consumer Secret for use later.
Setting up the connector in SmartConnect
- Login to login.smartconnect.com.
- Navigate to Connections > Create Connection button (or edit an existing Salesforce connection).
- Select Salesforce.
- Sandbox/Production – Use tabs to configure Sandbox and Production connections in a single connector.
- Description – Friendly name for the connection.
- Create Tests – If selected, SmartConnect will create the necessary apex tests to promote your sandbox objects to production.
- Use OAuth – Check this box for OAuth authentication.
- Service URL – URL for the Salesforce Soap webservices.
- Format as: https://<instance>.salesforce.com/services/oauth2 where the instance is found at the start of this article.
- Organization Name – Read-only name of Organization (Populated after click Validate).
- Organization Type – Read-only Type of Organization (Populated after click Validate).
- OAuth Details
- Client Id – Consumer Key from Salesforce Setup.
- Client Secret – Consumer Secret from Salesforce Setup.
- Reset All Test Mappings – Reset all configured Test Class mappings to their default values.
- Click Validate and Allow the prompt for access.
- Save the Connector.