title: Windows authentication in MVC
body: <p>I want to check the login name of a user using windows authentication.
  I have this as a constructor of my controller:</p>
  
  <pre><code>public class HomeController : BaseController
  {
      public string UserIdentityName;
  
      public HomeController()
      {
          UserIdentityName = System.Web.HttpContext.Current.User.Identity.Name;// HttpContext.Current.User.Identity.Name;
      }
  }
  </code></pre>
  
  <p>But UserIdentityName returns empty string...</p>
  
  <p>I also have this at my web.config:</p>
  
  <pre><code>&lt;authentication mode="Windows" /&gt;   
  </code></pre>
  
  <p>any idea?</p>