title: How to use ASP.NET Identity without a database
body: <p>I am trying to implement custom authentication using the new ASP.NET Identity in an MVC 5 project.</p>
  
  <p>I have a <strong>single username and password</strong> that I want to use to restrict which pages of the website the user can see via [Authorize] tags on controllers and views. (Easy)</p>
  
  <p>I am migrating from a FormsAuthentication model whereby this was as simple as putting the credentials in the web.config.</p>
  
  <p>Because I only have a single username and password <strong>I don't want to use a database as the UserStore</strong>, instead <strong>I want ASP.NET Identity to retrieve the username and password from a custom configurationsection in the web.config</strong> (don't worry about that part).</p>
  
  <p>After much search, I can't find a code sample that doesn't rely on a database for ASP.NET Identity authentication.</p>
  
  <p>So i'm looking for a code sample that at the point of authentication, the user can put in custom code to check the username &amp; password against the credentials in the custom ConfigurationSection of the web.config.</p>
  
  <p>Can someone please point me in the right direction thanks.</p>
  
  <p><strong>Update :</strong> I've tried looking at this code sample but it doesn't even compile out of the box.. poor.
  <a href="http://code.msdn.microsoft.com/Simple-Aspnet-Identiy-Core-7475a961" rel="noreferrer">http://code.msdn.microsoft.com/Simple-Aspnet-Identiy-Core-7475a961</a></p>
  
  <p><strong>Update :</strong> The reason that I don't want to use FormsAuthentication is that I am writing a NuGet package that will be installed into a web application. One of the things the NuGet package will do is create a custom ConfigurationSection in the web.config that includes (among other things) a single username and password. I thought this would be safer as it wouldn't alter any existing FormsAuthentication settings currently in the target web application.</p>
  
  <p><strong>Update :</strong> I think I have got it working. Will post findings soon.</p>
  
  <p>-- Lee</p>