0
votes

So I have a ASP.NET site that use Windows Authenication that only does one thing:

    protected void Page_Load(object sender, EventArgs e)
    {
        somelabel.Text = HttpContext.Current.User.Identity.IsAuthenticated.ToString();
        return;
    }

Unfortunately it is always false for some reason. Here is my web.config

<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Windows"/>
<authorization>
  <allow users="*"/>
</authorization>
<customErrors mode="Off"/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>

I deployed it on my Windows 7 running IIS 7.5.

  • Windows Authentication is installed and enabled
  • Target framework is 4.0
  • Application pool pipeline thing is integrated
  • Extended protection in Windows Authentication is "off" and "accept" (tried both)
1

1 Answers

3
votes

Change the authorization section to:

<authorization>
  <deny users="?"/>
</authorization>

I think that by saying allow users="*" you are allowing every body access.

See this post by Scott Guthrie