Help: How to enable Windows Authentication on ASP.NET Development Server?

23,409

Solution 1

In order to configure IIS Express security settings:

  1. look for the IIS express symbol in the taskbar (system tray).
  2. Right click and select "All Applications".
  3. Click on the name of the site you want to change (although I believe the change is site wide)
  4. Click on the path in the config section below (it will open the applicationhost.config file)
  5. Search for the authentication section and make your changes

Example changes can be found here:

http://toadcode.blogspot.ca/2011/08/security-config-in-iis-express.html

Solution 2

ASP.Net Development Server is very limited. It only serves requests originating from the same machine that it is running on, and it will not serve files that are outside of its application scope. It is based on the Cassini server. Cassini does not support WCF web services. Documentation for ASP.Net Development Server says that it does support NTLM. If you are just browsing to a page from the local machine it should work fine unless the page is referencing an unavailable resource.

check out http://msdn.microsoft.com/en-us/library/58wxa9w5.aspx for more info.

Solution 3

I would install and configure IIS on your local dev machine and use that in preference to using the inbuilt webserver. To use local IIS to debug select "User Local IIS web server" on the web tab of the project properties. Using IIS rather than the inbuilt webserver also means that you can configure your app in exactly the same way as it will be configured on the production server and this will reduce the no of potential surprises when you move to the production environment.

Solution 4

The solution to my authorization issue was to go into the F4 project properties and set the following:

Anonymous Authentication: Disabled

Windows Authentication: Enabled

Apparently these properties update the IIS applicationHost.config directly.

http://provenstyle.com/blog/2015/10/02/Visual-Studio-2015-Windows-Authentication-And-IIS-Express/

Share:
23,409
Admin
Author by

Admin

Updated on September 22, 2020

Comments

  • Admin
    Admin over 3 years

    I hope any of you guys knows how to fix this issue we are having.

    We are trying to host a WCF service via the web. We set the web.config to have the service require windows authentication. The problem we are having is the following:

    When we host our service in a regular IIS, the service runs fine and there is no issues with the "Windows Authentication" mode. However, when we try to run it from our developer boxes we get the following error: "Security settings for this service require Windows Authentication but it is not enabled for the IIS application that hosts this service."

    Our developers boxes are not hosting the service through the regular IIS but rather through Visual Studio's APS.NET Development Server. We tried going into the web project properties and said to enable NTLM authentication but that still did not fix it. Does anyone know how to fix it? Does VS ASP.NET Development Server even support Windows Authentication? Is the only option for hosting the service with Windows Authentication is to use IIS and forget about ASP.NET Development Server?

    Thanks Chuck

  • chiwal
    chiwal over 9 years
    Thanks Brett! Out of all the solutions I tried, this did it for me. Make sure to NOT put the following in your config if trying the above solution: <serviceAuthenticationManager authenticationSchemes="Basic" />.
  • DontFretBrett
    DontFretBrett almost 9 years
    Awesome thanks! I upgraded to VS 2015 and I was having this issue but your solution fixed it for me!