Search code examples
iisasp.net-corewindows-authenticationkestrel-http-server

asp.net core windows authentication on local iis


I created default asp.net core application from defaut template. I chose Windows Authentication option during porcess of creation of new project (here is what i did). When i run app on issexpress, it works like a charm.

When i moved app onto local iis it works, but it does not get user info. I enabled windows authentication in windows features. But it shows me empty User.Identity.Name. I tried to add this lines to web.config

    <security>
        <authentication>
            <windowsAuthentication enabled="true" />
            <anonymousAuthentication enabled="false" />
        </authentication>
    </security>

Tried to turn on windows authentication from IIS Manager. I dont know what else can be wrong. What am i missing?


Solution

  • I could resolve this issue. I turned on windows authentication feature on local iis and after that local authentication worked like a charm. Here is a good article how to do that.