<p>I'm working on a website built with pure HTML and CSS, and I need a way to restrict access to pages located within particular directories within the site. The solution I came up with was, of course, ASP.NET Forms Authorization. I created the default Visual Studio log in form and set up the users, roles, and access restrictions with Visual Studio's wizard. The problem is, I can't log in to the website with the credentials that I have set.</p>

<p>I'm using IIS 7.
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­</p>

[{'answer_id': 25408, 'author': 'jdecuyper', 'author_id': 296, 'author_profile': 'https://Stackoverflow.com/users/296', 'pm_score': 0, 'selected': False, 'text': "<p>At what point did you insert your login/password? Did you have a look at the tables that where created? Althought your password must be encrypted, maybe it's worth just checking if your user was actually created.</p>\n"}, {'answer_id': 25422, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 0, 'selected': False, 'text': "<blockquote>\n  <p>At what point did you insert your login/password? Did you have a look at the tables that where created? Althought your password must be encrypted, maybe it's worth just checking if your user was actually created.</p>\n</blockquote>\n\n<p>Forms Authentication does not require any form of user database.</p>\n\n<p>Steve, can you please paste in your forms authentication web.config section, also any relevant code to the ASP.NET Login control you were using.</p>\n\n<p>There is not enough information to troubleshoot here yet :)</p>\n"}, {'answer_id': 25451, 'author': 'Steve', 'author_id': 1857, 'author_profile': 'https://Stackoverflow.com/users/1857', 'pm_score': 0, 'selected': False, 'text': '<p>The web.config section is pretty useless as far as I can tell:</p>\n\n<pre><code>&lt;authentication mode="Forms" /&gt;\n</code></pre>\n\n<p>I looked in IIS 7, and in the Authentication section it says: Anonymous Authentication = Enabled, ASP.NET Impersonation = Disabled, Basic Authentication = Disabled, Forms Authentication = Disabled.</p>\n\n<p>Also, I have made no changes to the code other than dragging a Login object onto the designer and changing the page it points at to index.html.</p>\n\n<p>Currently, the log in fails by displaying the log in failed text.</p>\n\n<p>EDIT: Earlier when I would try to navigate directly to a page that is restricted, I would receive a blue page saying that I had insufficient permissions.  Now I can see the pages that are restricted without logging in even though I have anon access denied.</p>\n'}, {'answer_id': 25603, 'author': 'Mark Brackett', 'author_id': 2199, 'author_profile': 'https://Stackoverflow.com/users/2199', 'pm_score': 2, 'selected': False, 'text': "<p>I'd guess (since I don't have IIS7 handy ATM) that you'd need to turn off Anonomyous Auth, and enable Forms Auth in the IIS7 sections.</p>\n"}, {'answer_id': 872068, 'author': 'Brad Crandell', 'author_id': 97949, 'author_profile': 'https://Stackoverflow.com/users/97949', 'pm_score': 0, 'selected': False, 'text': '<p>Steve, </p>\n\n<p>I don\'t think the issue is with your IIS settings.  Because forms authentication does not rely on IIS authentication, you should configure anonymous access for your application in IIS if you intend to use forms authentication in your ASP.NET application. </p>\n\n<p>Try this in your web.config:</p>\n\n<pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;\n&lt;configuration&gt;\n  &lt;system.web&gt;\n    &lt;authentication mode="Forms" &gt;\n      &lt;forms loginUrl="~/login.aspx" defaultUrl="~/"&gt;\n        &lt;credentials passwordFormat="Clear"&gt;\n          &lt;user name="YourUsername" password="superSecret" /&gt;\n        &lt;/credentials&gt;\n      &lt;/forms&gt;\n    &lt;/authentication&gt;\n    &lt;authorization&gt;\n      &lt;deny users="?"/&gt;\n    &lt;/authorization&gt;\n  &lt;system.web&gt;\n&lt;/configuration&gt;\n</code></pre>\n\n<p>There are better ways to implement forms authentication than hardcoding a username and password into your web.config, but this should work for getting you started.</p>\n'}]
['https://Stackoverflow.com/questions/25396', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1857/']