【发布时间】:2012-10-09 18:38:39
【问题描述】:
我正在使用表单身份验证并从 Visual Studio 2010 启动一个站点。它使用的是 Visual Studio 开发 (web) 服务器而不是 IIS。 web.config 有:
<authenticaion mode="Forms">
<forms name=".MyApp" protection="All" cookieless="UseCookies"/>
</authentication>
登录页面正在使用 ASP.NET 登录控件。在用户登录之前,我可以看到以下内容:
HttpContext.Current.Request.LogonUserIdentity.AuthenticationType == "NTLM"
HttpContext.Current.User.Identity == System.Security.Principal.GenericIdentity
HttpContext.Current.User.Identity.AuthenticationType == "NTLM"
这个用户似乎被认证为本地系统用户而不是网络用户。这是否意味着用户将始终通过身份验证,无论他们是否登录该站点?
网络用户 NTLM 怎么样?
【问题讨论】:
-
您在 IIS 中的身份验证设置是什么样的?
-
Request.LogonUserIdentity表示 IIS 的运行方式。 -
@Erix:如上所述,我没有使用 IIS。
-
@Daniel,有没有办法通过表单身份验证来验证网络用户的身份验证?或者它不处理那个?
-
这似乎是答案stackoverflow.com/questions/833786/…。 Page.User.Identity.IsAuthenticated
标签: c# asp.net .net visual-studio-2010