In this blog post; I am going to explain how to integrate Active Directory with Sitecore. The Sitecore CMS Active Directory module provides the integration of Active Directory domain with the Sitecore CMS solution. You can integrate the domain users and groups available into Sitecore CMS as Sitecore users and Sitecore roles immediately after the module installation and configuration. The Active Directory module is based on the ASP.NET security model architecture.
Basic configuration steps:
- Download Active Directory Module: Download Active Directory Module from Sitecore SDN.
- Install Active Directory Module: After package installation, you have to modify few configuration files to complete the installation. In the main /App_Config/connectionstrings.config file, add a connection string to the <connectionStrings> section. For example:
<connectionStrings> <add name="LDAPConnString" connectionString="LDAP://ADServer.domain.name/OU=Managers,DC=ADDomain,DC=company,DC=com"/> </connectionStrings>
- In this example, Managers is just a sample organization unit. Replace it with the name of a real OU.
- The LDAP prefix is case sensitive. You should use only capital letters when writing the LDAP prefix.
- For more information about the format of the LDAP connection string, see the article LDAP ADsPath on MSDN.
- Configuring the Membership Provider: Open the web.config file, search for the <membership> element in the <system.web> section and paste the following definition inside it (the order is not important).
<add name="customAD" type="LightLDAP.SitecoreADMembershipProvider" connectionStringName="LDAPConnString" applicationName="sitecore" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" connectionUsername="[Enter User Name]" connectionPassword="[Enter Password]" connectionProtection="Secure" attributeMapUsername="sAMAccountName" enableSearchMethods="true" />
In above lines, replace connectionUsername and connectionPassword. To connect to the Active Directory domain, you should specify a user who has sufficient rights to perform the necessary operations. The provider uses these credentials when it connects to the AD domain. - Configuring the Role Provider: Open the web.config file, search for the <roleManager> element in the <system.web> section and paste the following definition inside it (the order is not important).
<add name="customAD" type="LightLDAP.SitecoreADRoleProvider" connectionStringName="LDAPConnString" applicationName="sitecore" username="[Enter User Name]" password="[Enter Password]" attributeMapUsername="sAMAccountName" cacheSize="2MB" />
In above lines, replace connectionUsername and connectionPassword. - Activating Switching Providers: To make the Sitecore aware of an extra source of users and roles, the switching mechanism must be activated. To activate the switching mechanism make below changes:
- In web.config file, in <system.web> section, browse for <membership> element and find the provider called sitecore and set its realProviderName attribute to switcher.
- In web.config file, in <system.web> section, browse for <roleManager> element and find the provider called sitecore and set its realProviderName attribute to switcher.
- Adding a New Domain: Open the App_Config/Security/Domains.config.xml file and add the following line to the root element:
<domain name="customAD" ensureAnonymousUser="false"/>
- Adding the Domain-Provider Mappings: Open web.config file and in <sitecore> section, browse to the <switchingProviders> element.
- Add the following line to the <membership> group — the order is not important:
<provider providerName="customAD" storeFullNames="false" wildcard="*" domains="customAD" />
- Add the following line to the <roleManager> group — the order is not important:
<provider providerName="customAD" storeFullNames="false" wildcard="*" domains="customAD" />
- Add the following line to the <membership> group — the order is not important:
0 comments :
Post a Comment