vNext的Windows身份验证

时间:2015-11-09 13:48:41

标签: asp.net asp.net-core

我想用Windows身份验证构建asp.net vNext网站 当我从模板创建时,我看到Windows身份验证选项被禁用。

我尝试将此代码放在Web.config

.spinner

我没有得到任何授权用户

所以我找到了这个

<system.web>
<authentication mode="Windows"/>
<authorization>
  <deny users="?"/>
</authorization>
</system.web>

我把它放在web.config中并得到500.19内部服务器错误 我尝试通过添加

来解决这个问题
<?xml version="1.0" encoding="utf-8"?>
   <configuration>
     <system.webServer>
       <security>
  <authentication>
    <windowsAuthentication enabled="true" />
    <anonymousAuthentication enabled="false" />
  </authentication>
</security>
<handlers>
  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <remove name="OPTIONSVerbHandler" />
  <remove name="TRACEVerbHandler" />
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
       </system.webServer>
   </configuration>
在applicationhost.config中

。但我仍然得到错误500.19

可以在vNext中使用Windows身份验证吗?

1 个答案:

答案 0 :(得分:0)

我找到了答案:我转到调试页面并启用复选框&#34;启用Windows验证&#34;并关闭复选框&#34;启用匿名验证&#34;