Sitecore-Salesforce Part 1 : Integration Steps, Issues, Troubleshooting

Prerequisites

  1. Sitecore Instance should be installed and functional.
  2. Downloaded package of Salesforce Connect Module. Download path: https://marketplace.sitecore.net/Modules/Salesforce_Connect_Module.aspx
  3. Proper permissions should be given to your instance folder residing inside the web root, such as full access permissions to IIS_IUSRS should be given.
  4. Salesforce configuration part as mentioned in the user guide present at path: https://github.com/adamconn/sitecore-salesforce-connect/tree/master/docs , should be completed.

Environment specifics of our Case Study:

Name Tool/Technologies
Operating System Windows 7 Professional (64 Bit)
Development Tool Visual Studio 2012, .net Framework 4.5
Web Server IIS 7.5
Database SQL Server 2008 R2 SP1
Framework .net Framework 4.5
Model View Controller MVC 5.2
Sitecore Sitecore Experience Platform 8.1 rev. 151207
Sitecore-Salesforce Integration tool Salesforce Connect 1.0 rev. 150130

Installation Steps 

  1. Login Sitecore, go to Sitecore desktop -> Development Tools -> Click on Installation Wizard.

1

  1. Upload the Salesforce Connect package that you have downloaded and click next.

2

  1. While uploading check the “Overwrite Existing Files” checkbox.

3

  1. Now click on next.

4

  1. You will see the reader’s note screen. Read and click next.

5

  1. Click on “Install” and you will see a screen like the screen shot depicted below. It will take anywhere between 5-20 minutes to get installed. For me it took only 5 minutes.

6

  1. Once installed, you will see a screen as below. It says “The package has been installed”. And you will be prompted with two options: choose “Restart Sitecore Client” and click “Close”.

7

  1. Your installation part is complete. Let’s move to the configuration part.

Configuration Steps 

1.    Add Domain name in Domain.config:

  • Go to App_Config -> Security Folder.
  • Open Domains.config and make an entry for Salesforce domain:

   <domain name=”salesforce” AccountNameValidation=”.+” ensureAnonymousUser=”false” defaultProfileItemID=”{4F2D283A-1035-498F-8E66-B02EC5B816E0}” />  

2.    Add Switching Providers in Sitecore.config to map domain-provider:

For partial Salesforce support installation, the entry for salesforce should be added only for membership and profile and not for role provider as depicted in the screen shot above.

8

Note: In previous versions of Sitecore, you will find the Switching Providers element in web.config itself, as Sitecore.config is not present there.

3.    Modify web.config as shown below:

Make the following changes to configuration > system.web:

<membership defaultProvider=”sitecore” hashAlgorithmType=”SHA1″>

<providers>

<clear />

<add name=”sitecore” type=”Sitecore.Security.SitecoreMembershipProvider, Sitecore.Kernel” realProviderName=”switcher” providerWildcard=”%” raiseEvents=”true” />

<add name=”sql” type=”System.Web.Security.SqlMembershipProvider” connectionStringName=”core” applicationName=”sitecore” minRequiredPasswordLength=”1″ minRequiredNonalphanumericCharacters=”0″ requiresQuestionAndAnswer=”false” requiresUniqueEmail=”false” maxInvalidPasswordAttempts=”256″ />

<add name=”switcher” type=”Sitecore.Security.SwitchingMembershipProvider, Sitecore.Kernel” applicationName=”sitecore” mappings=”switchingProviders/membership” />

<add name=”salesforce” type=”Sitecore.Salesforce.Security.SalesforceMembershipProvider, Sitecore.Salesforce” applicationName=”sitecore” readOnly=”false” enablePasswordReset=”true” minRequiredPasswordLength=”1″ passwordStrengthRegularExpression=”.*” minRequiredNonalphanumericCharacters=”0″ maxInvalidPasswordAttempts=”5″ passwordAttemptWindow=”0″ requiresQuestionAndAnswer=”false” requiresUniqueEmail=”true” />

</providers>

</membership>

<profile defaultProvider=”switcher” enabled=”true” inherits=”Sitecore.Security.UserProfile, Sitecore.Kernel”>

<providers>

<clear />

<add name=”salesforce” type=”Sitecore.Salesforce.Profile.SalesforceProfileProvider, Sitecore.Salesforce” readOnly=”false” />

<add name=”sql” type=”System.Web.Profile.SqlProfileProvider” connectionStringName=”core” applicationName=”sitecore” />

<add name=”switcher” type=”Sitecore.Security.SwitchingProfileProvider, Sitecore.Kernel” applicationName=”sitecore” mappings=”switchingProviders/profile” />

</providers>

<properties>

<clear />

<add type=”System.String” name=”SC_UserData” />

<add type=”System.String” name=”FirstName” customProviderData=”salesforce:FirstName” />

<add type=”System.String” name=”LastName” customProviderData=”salesforce:LastName” />

<add type=”System.String” name=”JobTitle” customProviderData=”salesforce:Title” />

<add type=”System.DateTime” name=”Birthdate” customProviderData=”salesforce:Birthdate” />

<add type=”System.String” name=”Phone” customProviderData=”salesforce:Phone” />

</properties>

</profile>

4.    Modify Sitecore.Salesforce.config

Make the following changes.

  1. Uncomment the following section: configuration > Sitecore > salesforce > clients > client

<clients>

<client provider=”salesforce” type=”Sitecore.Salesforce.Client.SalesforceClient, Sitecore.Salesforce.Client” singleInstance=”true”>

<param desc=”authenticator” type=”Sitecore.Salesforce.Client.Security.PasswordAuthenticator, Sitecore.Salesforce.Client”>

<consumerKey></consumerKey>

<consumerSecret></consumerSecret>

<userName></userName>

<password></password>

<securityToken></securityToken>

</param>

</client>

</clients>

  1. Enter the consumer key and consumer secret values for the connected app you configured in Salesforce. Those values can be located by:
  2. Log into Salesforce as an administrator
  3. Navigate to Build > Create > Apps > Connected Apps > Sitecore App
  4. Enter the security token value for the Sitecore user you created in Salesforce. That value can be located by:
  5. Log into Salesforce as the Sitecore user
  6. Navigate to My Settings > Personal > Reset My Security Token
  7. Make the following changes to configuration > sitecore> salesforce > configurations > fieldMapping:

<fieldMapping type=”Sitecore.Salesforce.Configuration.SalesforceFieldMapping, Sitecore.Salesforce”>

<id>Id</id>

<login>Email</login>

<email>Email</email>

<description>Description</description>

<password></password>

<passwordAnswer></passwordAnswer>

<passwordQuestion></passwordQuestion>

<isApproved></isApproved>

<isLockedOut></isLockedOut>

<createdDate>CreatedDate</createdDate>

<lastLoginDate></lastLoginDate>

<lastActivityDate></lastActivityDate>

<lastPasswordChangedDate></lastPasswordChangedDate>

</fieldMapping>

Salesforce Users in Sitecore

Go to User manager and you should be able to see all the Salesforce users too:

9

Troubleshooting

1.       Issue: Authentication Failure:

You get the below shown exception in the log file:

10

 Resolution 1: Please cross check the values you have entered in client element of the Sitecore.Salesforce.config file. It should be correct.

Resolution / Check point 2*: Please note that the Salesforce connect module does not work on sandboxes, since the sandboxes have URLs starting as test.salesforce.com. This module is compatible only with those Salesforce boxes which has the URLs starting with login.salesforce.com. Else, despite correct configuration you will get to see an “Authentication Failure” message in the log file.

2.       Issue: Installed and configured well, but still Salesforce contacts not visible in User Manager:

You trace the error “An error occurred while sending the request.” in the log file, as shown in the screen shot below:

 11

 Resolution 1: Your Sitecore application is not able to communicate with your Salesforce box. Please contact your Network Security team. It can be because of Firewall, proxy server or an anti-virus preventing the connection from succeeding.

Please note that this blog covers the Partial Integration of Salesforce Connect Module with Sitecore

*I will be sharing the Detailed analysis/findings and resolutions on the Resolution/Check Point 2 mentioned above, in my next blog.

One thought on “Sitecore-Salesforce Part 1 : Integration Steps, Issues, Troubleshooting

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>