I have this situation where the main domain requires Anonymous Authentication while the sub-domain can only accept Windows Authentication for my app to work.
Currently, I can only do one or the other on IIS. Basically, in my service it's expecting WindowsIdentity
and unless it's coming through Windows Authentication
it'll becomes ClaimsIdentity
. I want to ensure that the identity of this request is a Windows and is authenticated.
I've tried enable Anonymous Authentication and Windows Authentication for the main domain and disabled Anonymous Authentication & enabled Windows Authentication for sub-domain.
Folder and site structure:
Folder
inetpub /myservice /wwwroot /mysubdomain
In IIS
Default Web Site /myservice /wwwroot /mysubdomain
I made the request via http://localhost/myservice/mysubdomain
. If I publish my service as IIS
in Visual Studio 2019, Windows Authentication works but Anonymous Authentication doesn't. If I publish my service as myservice
project then Anonymous Authentication works but Windows Authentication doesn't.