Mix anonymous and windows authentication for web services in the same directory
iis, web-services, windows-authentication
Solution
Check out the location element in the `web.config` file. Please see:
http://msdn.microsoft.com/en-us/library/b6x6shw7(v=vs.100).aspx
and
http://msdn.microsoft.com/en-us/library/ms178692(v=vs.100).aspx
To quote:
By using the location element with an appropriate value for the path attribute, you can apply configuration settings to specific folders and files.
Problem
I have a web application containing two web services, let's say PublicHello.asmx and RestrictedHello.asmx. PublicHello must be accessed from anywhere, without requiring login. RestrictedHello must be accessed only from domain through Windows authentication (and its behavior is different from one user to another). In IIS, - if I enable both Anonymous Authentication and Windows Authentication, then RestrictedHello always shows that the user is not logged in (even if credentials are correctly send). - if I enable only Windows Authentication, then PublicHello requires login. Is there a way to use different authentication levels for different web services in the same web application/virtual directory? I imagine it is impossible, but I'm not sure...