title: Where can I load the user information to the session in ASP.NET MVC 5 with windows authentication?
body: <p>I want to use the ASP.NET MVC 5 for my web app. I need use the <code>windows authentication</code>.</p>
  
  <p>If I use the <code>windows authentication</code> where is the best place for reading user information (userid and roles) and store its to the <code>Session</code>?</p>
  
  <p>I have the method for getting the user information by username from the database like this:</p>
  
  <pre><code>public class CurrentUser
      {
          public int UserId { get; set; }
  
          public string UserName { get; set; }
  
          public Roles Roles { get; set; }
      }
  
      public enum Roles
      {
          Administrator,
          Editor,
          Reader
      }
  
      public class AuthService
      {
          public CurrentUser GetUserInfo(string userName)
          {
              var currentUser = new CurrentUser();
  
              //load from DB
  
              return currentUser;
          }
      }
  </code></pre>