title: Authentication through web.config not authenticating in ASP.net 3.5
body: <p>This is one of this things that should be extremely simple and I just can't work out why it's not working.</p>
  
  <p>I'm trying to set up some very quick authentication for an ASP.net 3.5 app but storing the usernames and passwords in the web.config file (I know it's not very secure but it's an internal app that I keep getting asked to add and remove logins for so this is the quickest way to do it).</p>
  
  <p>So, the relevant config section looks like this:</p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
     &lt;forms loginUrl="~/login.aspx"&gt;
      &lt;credentials&gt;
       &lt;user name="user" password="password" /&gt;
       &lt;user name="user2" password="password2" /&gt;
      &lt;/credentials&gt;
     &lt;/forms&gt;
    &lt;/authentication&gt;
  
    &lt;authorization&gt;
      &lt;deny users="?"/&gt;
    &lt;/authorization&gt;
  </code></pre>
  
  <p>And, in the login page, the code look like this:</p>
  
  <pre><code>string username = tbUsername.Text;
  string password = tbPassword.Text;
  
  if (FormsAuthentication.Authenticate(username, password))
      FormsAuthentication.RedirectFromLoginPage(username, false);
  </code></pre>
  
  <p>But, FormsAuthentication.Authenticate(username, password) always returns false. And I can't figure out why.</p>
  
  <p>I even tried using Membership.ValidateUser but that just adds in a local database to the App_Data folder.</p>
  
  <p>Is there something really basic I'm forgetting here or does this not work at all in .net 3.5?</p>