【发布时间】:2014-01-24 01:46:15
【问题描述】:
下面是 web.config
<authentication mode="Windows" />
<authorization>
<allow users="*"/>
<deny users="?" />
</authorization>
但是当我在 Visual Studio 中调试时,HttpContext.Current.User.IsAuthenticated 为 false,而 HttpContext.Current.User.Identity.Name 保持为空
为什么会这样?
当我将 web.config 更改为此时,显示 401 错误...
<authorization>
<deny users="?" />
</authorization>
【问题讨论】:
-
答案可能会有所不同,但请查看this post。它有一些很棒的资源。
-
@NicholasV。请看一下我的编辑,刚刚在 web.config 中禁用了匿名访问,但显示未经授权的访问错误..
标签: asp.net visual-studio authentication visual-studio-2012