Associate a Sitecore Commerce 7.5, powered by Commerce Server and Commerce Server 11.1 Membership Provider with Sitecore

Complete the following procedure to use the Sitecore Commerce 7.5, powered by Commerce Server and Commerce Server 11.1 Profile System to authenticate user profiles, allowing your users to log in using their existing credentials.

Complete the following prerequisites:

This example will setup the UPM provider using the UserObject.GeneralInfo.email_address as the login name.

At your Visual Studio solution setup:

  1. Edit the Sitecore web.config file at configuration/system.web/membership/providers:
    1. Add the Commerce Server UPM Membership Provider .
      <add name="UPM" type="CommerceServer.Core.Runtime.Profiles.UpmMembershipProvider, CommerceServer.Core.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=f5c79cb11734af7a" applicationName="sitecore" enablePasswordReset="false" requiresQuestionAndAnswer="false"/>
    2. Add the Commerce Server switching provider
      <add name="commerceSwitcher" ="Sitecore.Commerce.Connect.CommerceServer.Profiles.CommerceServerSwitchingMembershipProvider,
              Sitecore.Commerce.Connect.CommerceServer" applicationName="sitecore" mappings="switchingProviders/membership" />
      Change the Sitecore membership provider realProviderName to be commerceSwitcher
      <add name="sitecore" type="Sitecore.Security.SitecoreMembershipProvider, Sitecore.Kernel" realProviderName="commerceSwitcher" providerWildcard="%" raiseEvents="true" />
    3. Change the Sitecore membership provider realProviderName to commerceSwitcher
      <add name="sitecore" type="Sitecore.Security.SitecoreMembershipProvider, Sitecore.Kernel" realProviderName="commerceSwitcher" providerWildcard="%" raiseEvents="true" />
  2. Edit the Website\App_Config\Include\CommerceServer.Profiles.config file
    1. Add the membership provider info to /configuration/sitecore/switchingProviders
      <membership>
        <provider patch:before="*[@providerName='sql']" providerName="UPM" storeFullNames="false" wildcard="%" domains="CommerceUsers"/>
      </membership>
    2. Change store full names to false on the profile provider
      <profile>
        <provider patch:before="*[@providerName='sql']" providerName="cs" storeFullNames="false" wildcard="%" domains="CommerceUsers"/>
      </profile>
    3. Change the link property to the GeneralInfo.email_address property
      <profiles>
        <SitecoreLinkProperty name="GeneralInfo.email_address" />
      </profiles>
  3. Modify the Sitecore Commerce 7.5, powered by Commerce Server and Commerce Server 11.1 profile schema:
    1. Ensure that the GeneralInfo.email_address column is indexed and set as a primary key
    2. Don’t allow email address to be null, and ensure it is unique
    3. Remove the index from ExternalID (add a column if its not there)
    4. Allow for ExternalID to be null
  4. Set ensureAnonymousUser to false for the CommerceUsers domain and add the default profile item id in the Sitecore Website\App_Config\Security\Domains.config file.
     < domain   name = " CommerceUsers "   ensureAnonymousUser = " false "   defaultProfileItemId = " {0FFEC1BD-4D35-49CF-8B7D-7F01930834ED} "  />
  5. Enable SitecoreUser Manager to create users.
    1. Add the following to the Sitecore web.config file under /configuration/sitecore/settings
      <setting name="AccountNameValidation" value=".+" />
    2. Remove the Password Question and Password Answer from theSitecore Commerce 7.5, powered by Commerce Server and Commerce Server 11.1 profile schema.
      Note: If you wish to keep these properties, you cannot create users through the Sitecore User manager, however, editing/deleting of users will still work.