We want to create multiple Sitecore security domains for different groups and their users. Can you advice as how to achieve this?
2 Answers
You can use the Domain Manager within Sitecore to create new security domains. From the Sitecore Desktop:
Start > Security Tools > Domain Manager
From there, you can setup your Sitecore Roles specifing your new domains, then assign users to the Domain Role.
Editing the domains through the Domain Manager
tool will cause \App_Config\Security\Domains.config
to be updated with the added details. If you are updating this tool then make sure you include this in your project or copy it across to the other environments.
Unfortunately, the domains node is not patchable with Sitecore config overrides since it sits outside the <sitecore>
node. You can however use a different domainManager
which will use config and allow your domains to be patched like any other Sitecore config section.
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<domainManager defaultProvider="file">
<patch:attribute name="defaultProvider">config</patch:attribute>
</domainManager>
</sitecore>
</configuration>
You can then patch in whatever domains you want:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<domainManager>
<domains>
<domain id="MyCustomNewDomain1" type="Sitecore.Security.Domains.Domain, Sitecore.Kernel">
<param desc="name">$(id)</param>
<ensureAnonymousUser>false</ensureAnonymousUser>
</domain>
<domain id="MyCustomNewDomain2" type="Sitecore.Security.Domains.Domain, Sitecore.Kernel">
<param desc="name">$(id)</param>
<ensureAnonymousUser>false</ensureAnonymousUser>
</domain>
</domains>
</domainManager>
</sitecore>
</configuration>
You can read more about this in Configuring domains from patch files post by Kam Figy.
-
-
2You may also find this answer helpful. It covers how to implement a provider that supports both options sitecore.stackexchange.com/questions/1965/… Commented Dec 3, 2016 at 21:46