I'm trying to configure the IIS Authentication settings from my MVC5 project in the Web.config file.
Here's what I have. I want Windows Authentication enabled and Anonymous Authentication disabled.
But after publishing my package in IIS, the settings are this.
What do I need to do to also set the Anonymous Authentication to Disabled in the Web.config?
Isn't that what <deny users "?"/>
is supposed to be doing?
Here we go step by step:
Open Internet Information Services (IIS) Manager:
On the taskbar, click Start, point to Administrative Tools, and then click
Internet Information Services (IIS) Manager.
If you are using Windows Vista or Windows 7:
Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager.
Or you can disable by config file:
<location path="Contoso">
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" /> <!--This line you need-->
<basicAuthentication enabled="true" defaultLogonDomain="Contoso" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
</location>
Deny Anonymous user to access entire website:
<authorization>
<deny users="?" ></deny>
</authorization>
Hope it helps;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With