本地iis上的asp.net核心Windows身份验证

时间:2016-04-30 11:54:23

标签: iis asp.net-core windows-authentication kestrel-http-server

我从defaut模板创建了默认的asp.net核心应用程序。在创建新项目(here is what i did)的过程中,我选择了Windows身份验证选项。当我在issexpress上运行应用程序时,它就像一个魅力。

当我将应用程序移动到本地iis时,它可以工作,但它不会获得用户信息。我在Windows功能中启用了Windows身份验证。但它显示我空的User.Identity.Name。我试图将这些行添加到web.config

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

尝试从IIS管理器启用Windows身份验证。我不知道还有什么可能是错的。我错过了什么?

2 个答案:

答案 0 :(得分:1)

在web.config中,你放了

<authentication mode="Windows" /> 

在system.web部门也是如此?

答案 1 :(得分:1)

我可以解决这个问题。我打开了本地iis上的Windows身份验证功能,之后本地身份验证就像魅力一样。 Here是一篇很好的文章,如何做到这一点。