• About this blog
  • About me
  • Contact
Sitecore XperiencesThe things I've seen as a Sitecore Professional
  • About this blog
  • About me
  • Contact
Menu
  • About this blog
  • About me
  • Contact
  • Best way to setup Active Directory Module in a Sitecore Solution

    March 23, 2015 Rodrigo Peplau 1

    Connecting Sitecore with an LDAP Server is pretty easy with Sitecore’s Active Directory Module. Setting up the module is not hard, but if you follow the official documentation you’ll end up updating a lot of your Web.config file, which may be a problem for several reasons:

    1. You can easily lose track on your customizations;
    2. Upgrading Sitecore for a newer version may become harder;
    3. During development you may be forced to turn your LDAP module off, basically undoing the setup of your providers, which is not straight-forward.

    After facing these issues a couple times I decided to look for a better approach.

    Using Includes

    Biggest limitation is by far the need to update your Web.config, as the changes are not in the Sitecore portion and thus cannot be automatically patched by files in your /App_Config/Include folder. Best you can do is to create patches with the configurations, then include them at the Web.config.

    Step by step

    1. Add the LDAP connection settings to your ConnectionStrings.config:

      <add name=”ManagersConnString” connectionString=”LDAP://yourldapserver.com:389/DC=your,DC=domain” />

    2. At your Web.config, find your <system.web> section and comment out your <membership>, <roleManager> and <profile> nodes – these will be all replaced by includes;
    3. At the same level you commented out, add a <machineKey> node as covered at the official documentation:

        <machineKey validationKey=”BDDFE367CD36AAA81E195761BEFB073839549FF7B8E34E42C0DEA4600851B0065856B211719ADEFC76F3F3A556BC61A5FC8C9F28F958CB1D3BD8EF9518143DB6″ decryptionKey=”0DAC68D020B8193DF0FCEE1BAF7A07B4B0D40DCD3E5BA90D” validation=”SHA1″ />

    4. Still at this level let’s add three includes for Membership, RoleManager and Profile providers:

      <!– Includes –>
      <membership configSource=”App_Config\AD\Membership.config” />
      <roleManager configSource=”App_Config\AD\RoleManager.config” />
      <profile configSource=”App_Config\AD\Profile.config” />

    5. As well as the three includes for disabling the module. We let it commented for now, which makes the module enabled:

      <!–
      <membership configSource=”App_Config\AD\Membership_Disabled.config” />
      <roleManager configSource=”App_Config\AD\RoleManager_Disabled.config” />
      <profile configSource=”App_Config\AD\Profile_Disabled.config” />
      –>

    6. You have also to add your mapped domain(s) to App_Config\Security\Domains.config:

      <domain name=”ad” ensureAnonymousUser=”false”/>

    7. Now create a folder called “AD” at App_Config and drop the six config files that are zipped at this link:
      – AD-configs – Don’t forget to review all files (except the “_Disabled.config” that stores the native Sitecore configurations) to make sure you username, password and domains are corretly set!

    Now when you want to turn the module off you just have to comment out the lines from #4 and uncomment #5 – pretty easy.

    Categories: Active Directory, Architecture, Development, LDAP, Sitecore Modules

    Sitecore 7.5 and MongoDB through different environments Visual Studio Solution at Sitecore Projects - Avoiding IIS restarts with Robocopy in a Post Build event

    One thought on “Best way to setup Active Directory Module in a Sitecore Solution”

    • brijesh says:
      March 26, 2015 at 10:08 am

      Good stuff!! yes it is always good to have custom config files and patch them and you have showed it correctly how to do that for active directory module.

      Reply

    Leave a Reply Cancel 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=""> <strike> <strong>

Proudly 10x Sitecore MVP!
(2016-2025)

Localization

Recent Posts

  • All Submissions from Sitecore Hackathon 2025!
  • Know your Media Library disk usage with a simple PowerShell script
  • Automated Behavioral Personalization in Sitecore XP with Generative AI
  • MVPinny knows the Sitecore Accelerate for Partners
  • Rodrigo Peplau wins Sitecore Most Valuable Professional award

Recent Comments

  • navan on Meet MVPinny: the AI-Powered Sitecore Assistant
  • Adriana on Content generation with Sitecore Connect and ChatGPT
  • NAVAN on Automatic Sitecore NuGet upgrades with Powershell
  • Hedipo S Menezes on Corey Peplau wrote this - WFFM conflict with Unity DI and a lesson on how Sitecore community is so amazing
  • Rodrigo Peplau on ERROR [Content Testing]: Cannot find PhantomJS executable at ' (...) /data/tools/phantomjs/phantomjs.exe'. Aborting screenshot generation.

Archives

  • March 2025
  • January 2025
  • June 2024
  • April 2024
  • February 2024
  • December 2023
  • November 2023
  • August 2023
  • July 2023
  • January 2023
  • February 2022
  • December 2021
  • November 2021
  • March 2021
  • July 2020
  • February 2020
  • September 2019
  • July 2019
  • April 2019
  • March 2019
  • December 2018
  • February 2018
  • January 2018
  • November 2017
  • September 2017
  • August 2017
  • July 2017
  • March 2017
  • February 2017
  • November 2016
  • September 2016
  • August 2016
  • July 2016
  • April 2016
  • November 2015
  • September 2015
  • July 2015
  • April 2015
  • March 2015
  • February 2015

Categories

  • Actions
  • Active Directory
  • Analytics
  • Architecture
  • Bug fixing
  • CDP/Personalize
  • ChatGPT
  • Content Edition Experience
  • Content Hub
  • Continuous Integration
  • Dev
  • Development
  • Environments
  • Experience Editor
  • Experience Forms
  • Front-end
  • Hackathon
  • Health Check builds
  • Helix
  • How To
  • LDAP
  • MVP
  • MVP Summit
  • MVPinny
  • Phantom JS
  • Powershell
  • QA
  • Richtext Editor
  • Rules
  • Security Provider
  • SIF
  • Sitecore 9
  • Sitecore API
  • Sitecore Community
  • SItecore Connect
  • Sitecore Modules
  • Sitecore Rocks
  • Sitecore Rule Processor
  • Sitecore Symposium
  • SPE
  • SPE-only Alliance
  • SPEAK
  • SUG
  • Support Ticket
  • TDS
  • Team City
  • Uncategorized
  • Upgrades
  • Visual Studio
  • WFFM
  • Workflow
  • XConnect
  • xDB
  • XM Cloud

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Recent Posts

  • All Submissions from Sitecore Hackathon 2025!
  • Know your Media Library disk usage with a simple PowerShell script
  • Automated Behavioral Personalization in Sitecore XP with Generative AI
  • MVPinny knows the Sitecore Accelerate for Partners
  • Rodrigo Peplau wins Sitecore Most Valuable Professional award
  • Error enabling GraphQL IDE with XM Cloud
  • Meet MVPinny: the AI-Powered Sitecore Assistant
  • Content generation with Sitecore Connect and ChatGPT
  • XM Cloud Starter Kit with Content Hub Integration
  • Meet the (Brand new) Advanced Powershell Packaging Features

Tag Cloud

    Architecture Automation Continuous Integration Debugging Development Environments Hackathon How To PhantomJS Powershell Server Roles TDS Team City Team Development for Sitecore XConnect

Pages

  • About this blog
  • About me
  • Contact

Search

Copyright © 2015 Rodrigo Peplau Theme created by PWT. Powered by WordPress.org