asp.net-mvc - Windows 8 VS2012 IISExpress Windows身份验证

标签 asp.net-mvc windows-8 orchardcms iis-express

我正在尝试使Windows身份验证能够按照标题进行本地开发:

  • Windows 8(专业版)
  • VS2012
  • IISExpress
  • ASP.Net MVC4项目
  • Orchard CMS是项目(但我认为这不相关)

  • 通过项目属性,我将Windows身份验证设置为启用,并将匿名身份验证设置为禁用。

    在web.config中,我设置了:
    <authentication mode="Windows" />
    

    但是,在运行站点时,会不断提示我输入凭据。输入Windows 8或本地帐户凭据似乎没有什么区别,我将这些帐户设置为对该文件夹具有完全权限。

    任何建议,感激不尽!

    更新1:
    根据Darin Dimitrov的建议,我创建了一个空白的MVC项目并选择了Intranet模板。将“匿名授权”设置为“禁用”并启用“Windows身份验证”后,此测试项目完全按预期工作(输入凭据时提示提供对站点的访问权限)。我对我的Orchard项目web.config应用了相同的授权配置:
    <authentication mode="Windows" />
    <authorization>
      <deny users="?" />
    </authorization>
    

    但是仍然没有喜悦,我被提示输入预期的凭据,但是我输入的内容似乎都未授权用户。我已经粘贴了下面的两个web.configs,以防其他人指出我所缺少的内容?
  • Orchard Web.Config:http://pastie.org/private/8oe5jesvt0vmqgyn3w
  • 示例Web.Config:http://pastie.org/private/zgxyue03crzd6fb8umlidq
  • 最佳答案

    确保已在Web服务器的属性中启用Windows身份验证,并禁用了匿名身份验证:

    还要确保您已经阅读了使用Intranet模板创建新的MVC应用程序时为您生成的文本文件:

    In order to use the Intranet template, you'll need to enable Windows authentication and disable Anonymous authentication.

    IIS 7 & IIS 8

    1. Open IIS Manager and navigate to your website.
    2. In Features View, double-click Authentication.
    3. On the Authentication page, select Windows authentication. If Windows authentication is not an option, you'll need to make sure Windows authentication is installed on the server.

      To enable Windows authentication on Windows:

      a) In Control Panel open "Programs and Features".

      b) Select "Turn Windows features on or off".

      c) Navigate to Internet Information Services > World Wide Web Services > Security and make sure the Windows authentication node is checked.

      To enable Windows authentication on Windows Server:

      a) In Server Manager, select Web Server (IIS) and click Add Role Services

      b) Navigate to Web Server > Security and make sure the Windows authentication node is checked.

    4. In the Actions pane, click Enable to use Windows authentication.

    5. On the Authentication page, select Anonymous authentication.
    6. In the Actions pane, click Disable to disable anonymous authentication.

    IIS Express

    1. Click on your project in the Solution Explorer to select the project.
    2. If the Properties pane is not open, open it (F4).
    3. In the Properties pane for your project:
      a) Set "Anonymous Authentication" to "Disabled".
      b) Set "Windows Authentication" to "Enabled".

    关于asp.net-mvc - Windows 8 VS2012 IISExpress Windows身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14953983/

    相关文章:

    c# - 如何解析 Orchard CMS 中的对象?

    orchardcms - 如何通过Orchard模块保存数据?

    orchardcms - Orchard 1.8包安装失败

    c# - 如何解决 VS2012 中简单的 Nuget 安装导致 MVC4 Twitter Bootstrap 项目失败的问题?

    c# - MVC 中的服务总线 + webjob。将字符串作为消息发送

    windows-8 - 使用 MessageWebSocket 的 Windows 8 现代/地铁应用程序的 Socket.IO 文档

    javascript - metro Javascript。项目分组错误。 ui.js firstItemIndexHint 属性

    c# - 如何将列表框中的记录显示到数据表或 GridView ?

    asp.net mvc - 在 Razor 中提供交替行样式的最简单方法

    javascript - WinRT - Javascript - 是否可以实现 FTP、SSH、SFTP 等?