我需要在我的webApi 2.0中识别远程用户名和他的域,但无法做到这一点。我试着用了一些东西
ViewBag.userName1 = WindowsIdentity.GetCurrent().Name;
ViewBag.userName2 = System.Web.HttpContext.Current.User.Identity.Name.ToLower();
// will return the host name making the request
ViewBag.remoteHost = Request.ServerVariables["REMOTE_HOST"