The simplest way to enable Windows Authentication inside an ASP.NET MVC application is by executing one of the following options:
Option 1 - Configure the web.config.
Set the authentication mode to Windows and disable anonymous access inside the web.config:
Option 2 – Configure IIS Express.
Enable Windows Authentication Enabled in IIS Express. (If you want you can also disable Anonymous authentication).