【发布时间】:2023-03-11 19:43:01
【问题描述】:
我记得,我曾经使用以下代码获取登录用户 ID(用于 Intranet 应用程序):-
string WindowsLoginID= System.Web.HttpContext.Current.Request.ServerVariables["AUTH_USER"];// This is blank
当我在 ASP 应用程序的代码中使用它时,它仍然可以正常工作。
但是当我在MVC4 Application 中使用相同的代码时,它会返回给我blank。
我正在以Use Local IIS Web Server 的身份运行我的项目,并且我的 web.config 我有-
<authentication mode="Windows">
</authentication>
如果我在做一些愚蠢的事情,请告诉我。
【问题讨论】:
-
我也有同样的问题。 stackoverflow.com/questions/18847492/…
标签: asp.net-mvc-4 ldap