.NET Forms Authentication using IIS8.0 Express (vs2013) - 401.2 .: Unauthorized: Login failed due to server configuration

One note: I created Webapp authentication w / Individual User Accounts and added and it works exactly as expected. I wonder what is different from this app also when launched without authentication.

I created a new webforms application without authentication to make sure there is nothing specific in my project. Follow this tutorial to set up Basic Authentication. When I upload my project, I get the following error and then redirect me to my Login.aspx page. My overall goal is to create a webapp that basically prevents users from accessing any page unless they are logged in. Since I am specifying the login page in the form tag, I am assuming that it makes the page accessible to anonymous users so that everyone can log in. I feel like my problem is related to IIS8.0 Express or my project settings. 'Windows Authentication = Disabled' 'Anonymous Authentication = Enabled'.

<system.web>
  <authentication mode="Forms">
    <forms loginUrl="~/Security/Login.aspx" name=".ASPXFORMSAUTH" timeout="60">
    </forms>
  </authentication>
  <authorization>
    <deny users="?" />
  </authorization>
</system.web>

      

Below is the error:

Server error in application "/".

Access is denied.

Description. An error occurred while accessing the resources required to service this request. The server may not be configured to access the requested URL.

Error message 401.2 .: Unauthorized. Login failed due to server configuration. Make sure you have permission to view this directory or page based on the credentials you provided and the authentication methods enabled on the web server. Contact your web server administrator for further assistance.

Version Info: Microsoft .NET Framework Version: 4.0.30319; ASP.NET Version: 4.0.30319.34212

+3


source to share


1 answer


Had the same problem and found this in my web.config:

<system.webServer> <modules> <remove name="FormsAuthentication" /> </modules> </system.webServer>



Not really sure how it got there, but fixing this issue.

I figured I would post it just in case it helps others.

+4


source







All Articles