加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-15 20:58:50 所属栏目:asp.Net 来源:网络整理
导读:我正在尝试启用 Windows身份验证以在本地开发,根据标题: Windows 8(专业版) VS2012 IISExpress ASP.Net MVC4项目 Orchard CMS是项目(但我不认为这是相关的) 通过项目属性,我将Windows身份验证设置为已启用,并将匿名身份验证设置为已禁用. 在web.config我设
我正在尝试启用 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.conf进行过贴牌,以防有人能指出我缺少的东西吗?

> 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”.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读