Question:

What happens when you change the security domain setting for a site?

Nathan: 2 weeks ago

I was going through Sitecore domains documentation and found the link interesting.

https://www.linkedin.com/pulse/what-importance-security-domains-sitecore-rohit-chopra

Upon going through that, I was curios enough to change the domain on on my local site from 'extranet' to 'sitecore'. But nothing really happened. I was expecting if changing this domain to Sitecore would show login screen for accessing a local site too. But my local site is loading as usual.

What really happens when we change the domain setting?

     <site name="myLocalSite" patch:before="site[@name='website']"
              database="web"
              virtualFolder="/"
              physicalFolder="/"
              rootPath="/sitecore/content/*****/*****/******/IN/Home"
              startItem="/Home"
              **domain="sitecore"**
              allowDebug="true"
              cacheHtml="true"
              htmlCacheSize="50MB"
              registryCacheSize="0"
              viewStateCacheSize="0"
              xslCacheSize="25MB"
              filteredItemsCacheSize="10MB"
              enablePreview="true"
              enableWebEdit="true"
              enableDebugger="true"
              enableTracking="true"
              disableClientData="false"
              languageEmbedding="never"
              language="en"
              cacheRenderingParameters="true"
              renderingParametersCacheSize="10MB"
              hostName="*********************">
    <patch:attribute name="database" value="web" env:require="local" />   
  </site>

Answer:
Brielle: 2 weeks ago

From my recollection, domain on a site is used when you are trying to load a user by just the username.

For example, if you try to authenticate a user who has provided the username "SitecoreLeaner", you need to know what domain to look in. So you authenticate using the domain for the site.

By default, the external site is usually configured for 'extranet', so it would look for 'extranet\SitecoreLearner'. If you changed it to 'sitecore', like you did, then you would want to lookup 'sitecore\SitecoreLearner'.