【问题标题】:How to get current Active Directory user in ASP.NET when IIS is running under a service account当 IIS 在服务帐户下运行时,如何在 ASP.NET 中获取当前 Active Directory 用户
【发布时间】:2015-08-26 17:22:09
【问题描述】:

我需要从使用服务帐户作为 IIS 中的应用程序池标识的网站获取当前登录到 Active Directory 的用户的姓名和电子邮件地址。我尝试了以下两种方法,但它们返回的是服务帐户的名称,而不是实际登录网络的用户(这是有道理的)。

System.Security.Principal.WindowsIdentity.GetCurrent().Name

UserPrincipal.Current.EmailAddress

有人知道这是否可能吗?

【问题讨论】:

    标签: c# asp.net iis active-directory


    【解决方案1】:

    HttpContext.Current.User.Identity;

    应提供经过身份验证的用户的身份

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-04
      • 1970-01-01
      • 1970-01-01
      • 2010-10-12
      • 1970-01-01
      • 1970-01-01
      • 2019-12-23
      • 1970-01-01
      相关资源
      最近更新 更多