向Asp.net 5 Vnext配置文件添加授权

向Asp.net 5 Vnext配置文件添加授权,asp.net,asp.net-mvc,Asp.net,Asp.net Mvc,我试图在我的Asp.net 5 Vnext解决方案中限制用户访问 在课堂上,我在rootweb.config中使用了这一行: <system.web> <authentication mode="Windows" /> <authorization> <allow users="domain\user" /> <deny users="*" /> </authorization> <configuration

我试图在我的Asp.net 5 Vnext解决方案中限制用户访问

在课堂上,我在rootweb.config中使用了这一行:

<system.web>
<authentication mode="Windows" />
<authorization>
  <allow users="domain\user" />
  <deny users="*" />
</authorization>
<configuration>
  <system.webServer>
    <handlers>
      <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
    </handlers>
    <httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>

  </system.webServer>
    <system.web>
    <authentication mode="Windows" />
    <authorization>
      <allow users="domain\user" />
      <deny users="*" />
    </authorization>
  </system.web>


您是否尝试了最后一个选项,即身份验证而不是授权?因此:xxx@janpieter_z感谢您的回复,但如果我更换这些,它会给我500个服务器错误。可能是的重复。请注意,
system.webServer
部分仅适用于IIS/IIS Express,因此如果您以另一种方式托管应用程序,这些设置将不起作用。
<configuration>
  <system.webServer>
    <security>
      <authorization>
        <remove users="*" roles="" verbs="" />
        <add accessType="Deny" users="unknownname" />
        <add accessType="Allow" users="knownname" />
      </authorization>
    </security>
  </system.webServer>
</configuration>