April 27, 2020
Estimated Post Reading Time ~ 1 mins

Integration of AEM with Salesforce - Part1

AEM Salesforce cloud connector can be used to integrate to Salesforce via connected App configured in the Salesforce

AEM Salesfore integration supports the following functionalities:
Lead Search
Contact Search
Export AEM user as Salesforce Lead
Associate an AEM user with a Salesforce "Contact" or "Lead"
The connector can be extended to support the additional functionalities.

sain1

Defining the connected App in Salesforce: A connected app integrates an application with Salesforce using APIs
Connected apps use standard SAML and OAuth protocols to authenticate and provide tokens for use with Salesforce APIs. The required security policies can be set to control the connected Apps access.

Login to Salesforce - login.salesforce.com
Click on the user name- Setup- Click on Create then Apps
Create New connected App
Enter the name and Email address

salesforce15

Click on Enable OAuth settings
Add the below two OAuth scopes - Add the additional scopes if required

Access and manage your data (api)
Perform requests on your behalf at any time (refresh_token, offline_access)
Specify the call back URL - http://localhost:4502/etc/cloudservices/salesforce/<<AEM Salesforce Connector Name>>

e.g. https://localhost:5403/etc/cloudservices/salesforce/SalesforceConnect.html

The call back URL should be https
Click Save

salesforce16

Copy the Consumer Key and Consumer Secret

salesforce17

Click on Manage - Edit Policies
Select the following options

Relax IP restrictions
Refresh token is valid until revoked
Click on Save

salesforce18

AEM Configuration:
Open http://localhost:4502/etc/cloudservices/salesforce.html
e.g - https://localhost:4503/etc/cloudservices/salesforce.html
AEM server should be configured with https to enable the Salesforce integration.

Add new Configuration
salesforce4

Enter the Title - Specify the Tile Sames as whatever provided in the callback URL.
Click on Create

salesforce5
Enter the Customer Key and Customer Secret Values

salesforce6
Click on Connect to Salesforce - Wait for 10 mins after creating the Connected App in Salesforce

If the connection is success the browser will redirect to Salesforce login page
Page will be displayed with permission to required access to connected App - Click on Allow

salesforce8
The popup will be displayed with successful message after success connection. Click ok on the popup and the setting window

salesforce2
The redirect_mismatch error will be displayed if the calback URL configured in the Salesforce and the redirect_uri send by the Connector is not matching

salesforce7
The popup with error "Error Getting Access Token" will be displayed if the server is not able to connect to Salesfore login URL- login.salesforce.com

sales-in

Testing the integration: Use the "Salesforce.com Export workflow " to export the AEM user to Salesforce as Lead.
Edit the "Salesforce.com Export" workflow and select the Salesforce configuration

salesforce13

Enter all the mandatory field to the user profile
sales2

Run the workflow by selecting the required profile

salesforce13

The Lead will be created in Salesforce

salesforce13

This post is written based on AEM 6,1.

Reference: https://docs.adobe.com/docs/en/aem/6-1/administer/integration/third-party-services/salesforce.html
aem4beginner.blogspot


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.

Ad Blocker Detected :(

Please consider supporting us by disabling your ad blocker.

Please Disable your adblocker and Refresh the page to view the site content.