title: Sitecore - Require login
body: <p>So for my Sitecore site I am trying to make it so the user is logged in and can not use the extranet\Annoymous account.  I have read and tried </p>
  
  <p><a href="http://www.bolaky.net/post/Implementing-Sitecore-Extranet-login-on-a-website.aspx" rel="noreferrer">Implementing Sitecore Extranet login on a website</a></p>
  
  <p>But I missed something, the asp forms authentication has side issues that it returns you to the original page and thus ignoring the user's option of Desktop or Page Editor.</p>
  
  <p>The part where I am frustrated is that it seems this logic is already built into SiteCore.  For example if I try to go to <a href="http://site/sitecore/shell" rel="noreferrer">http://site/sitecore/shell</a> and I am not logged in site core redirects me to the login page.  So how can I turn this on for my entire site.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>My Security Editor looks like this 
  <img src="https://i.stack.imgur.com/0OfN1.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/D7Mu3.png" alt="enter image description here"></p>
  
  <p>Even if I unprotect the sitecore object and deny access to the main object 
  I can still get to the site.
  <img src="https://i.stack.imgur.com/XRl2q.png" alt="enter image description here"></p>
  
  <p>In the web.config my Sites section looks like this </p>
  
  <pre><code>&lt;sites&gt;
    &lt;site name="shell" virtualFolder="/sitecore/shell" physicalFolder="/sitecore/shell" rootPath="/sitecore/content" startItem="/home" language="en" database="core" domain="sitecore" loginPage="/sitecore/login" content="master" contentStartItem="/Base" enableWorkflow="true" enableAnalytics="false" analyticsDefinitions="content" xmlControlPage="/sitecore/shell/default.aspx" browserTitle="International" htmlCacheSize="2MB" registryCacheSize="3MB" viewStateCacheSize="200KB" xslCacheSize="5MB" disableBrowserCaching="true" /&gt;
    &lt;site name="login" virtualFolder="/sitecore/login" physicalFolder="/sitecore/login" enableAnalytics="false" database="core" domain="sitecore" disableXmlControls="true" /&gt;
    &lt;site name="admin" virtualFolder="/sitecore/admin" physicalFolder="/sitecore/admin" enableAnalytics="false" enableWorkflow="true" domain="sitecore" loginPage="/sitecore/admin/login.aspx" /&gt;
    &lt;site name="service" virtualFolder="/sitecore/service" physicalFolder="/sitecore/service" /&gt;
    &lt;site name="modules_shell" virtualFolder="/sitecore modules/shell" physicalFolder="/sitecore modules/shell" rootPath="/sitecore/content" startItem="/home" language="en" database="core" domain="sitecore" content="master" enableAnalytics="false" enableWorkflow="true" /&gt;
    &lt;site name="modules_website" virtualFolder="/sitecore modules/web" physicalFolder="/sitecore modules/web" rootPath="/sitecore/content" startItem="/home" language="en" database="web" domain="extranet" allowDebug="true" cacheHtml="true" /&gt;
    &lt;site name="website" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" startItem="/Base" database="web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="10MB" registryCacheSize="0" viewStateCacheSize="0" xslCacheSize="5MB" filteredItemsCacheSize="2MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" loginPage="/sitecore/login/Default.aspx" /&gt;
    &lt;site name="scheduler" enableAnalytics="false" domain="sitecore" cacheMedia="false" /&gt;
    &lt;site name="system" enableAnalytics="false" domain="sitecore" /&gt;
    &lt;site name="publisher" domain="sitecore" enableAnalytics="false" enableWorkflow="true" /&gt;
  &lt;/sites&gt;
  </code></pre>
  
  <p>I know who I am logged in as because I added this to my homepage</p>
  
  <pre><code>&lt;asp:Label ID="Id" runat="server"&gt;&lt;%=HttpContext.Current.User.Identity.Name%&gt;&lt;/asp:Label&gt;
  </code></pre>