【问题标题】:Set Http Basic Authentication at the project level (web.config)在项目级别设置 Http 基本身份验证 (web.config)
【发布时间】:2016-01-24 21:35:12
【问题描述】:

有什么办法吗?我已经看到引用的所有其他配置文件,但这个(通常是 IIS)但我需要它可以与项目一起移植。我有一个项目,我需要通过 SSL 上的基本 HTTP 身份验证进行演示,我没想到这会是困难的部分。

【问题讨论】:

标签: c# asp.net web-config basic-authentication


【解决方案1】:

将此代码放在system.web元素下的web.config文件中:

 <security>
  <authentication>
   <anonymousAuthentication enabled="false" />
   <basicAuthentication enabled="true" />
  </authentication>
 </security>

请记住基本身份验证。必须已在服务器上启用(通过打开/关闭 Windows 功能)

【讨论】:

  • 请注意,在 VS2015 中,此配置文件位于解决方案文件夹中。
猜你喜欢
  • 2015-10-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-31
  • 1970-01-01
  • 1970-01-01
  • 2021-03-21
  • 2011-11-12
  • 2011-05-05
相关资源
最近更新 更多