Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 362
F0rc0sigan Avatar asked Apr 30 '16 11:04

F0rc0sigan


2 Answers

In web.config, did you put

<authentication mode="Windows" /> 

in system.web sector as well?

like image 163
sgrsigma Avatar answered Sep 27 '22 16:09

sgrsigma


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.

like image 22
F0rc0sigan Avatar answered Sep 27 '22 17:09

F0rc0sigan