title: Windows Authentication - Getting current user name
body: <p>In my MVC application I want to render a table in a cshtml file, if the current log in user is some x person. I am using windows authentication and I have made the following changes in web.config file. </p>
  
  <pre><code>&lt;authentication mode="Windows"&gt;
        &lt;/authentication&gt;
  </code></pre>
  
  <p>And in my controller when I am trying to access the current user name I am not getting any user name. I am trying the following:</p>
  
  <pre><code>ViewBag.LogInUserName = Request.RequestContext.HttpContext.User.Identity.Name;
  </code></pre>
  
  <p>This above line was working before. But I don't know whats wrong now. Also I have hosted my application on IIS now.</p>