gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 13:51:57 24 4
gpt4 key购买 nike

我正在尝试使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/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com