Mix anonymity and Windows authentication for web services in the same directory

I have a web application containing two web services, say PublicHello.asmx and RestrictedHello.asmx.

PublicHello should be accessible from anywhere, without having to log in. RestrictedHello should only be accessible from a domain through Windows authentication (and its behavior differs from one user to another).

In IIS

  • if I turn on anonymous authentication and Windows authentication, RestrictedHello always shows that the user is not logged in (even if the credentials are sent correctly).
  • if I only allow 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 think this is impossible, but I'm not sure ...

+4
source share
1 answer

Check the location element in the web.config . Please look:

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

Quote:

Using the location element with the appropriate value for the path attribute, you can apply configuration settings to specific folders and files.

+4
source

Source: https://habr.com/ru/post/1302789/


All Articles