title: How Does Identity Work in Asp .Net MVC 5
body: <p>Say, I have a SQL Server Database containing usernames/passwords.  At my "login" view, I wish to enter data into the username/password text fields and when I click "login" I want to use my login Controller to compare those values against the values in the Database.  All of that is fairly straight forward:
  <a href="https://i.stack.imgur.com/lx39b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lx39b.png" alt="enter image description here"></a></p>
  
  <p>However, I want to use the <code>[Authorize]</code> Attribute on the remainder of my site's Controllers.  After granted access past the Login page, I can't seem to find any examples that explain how to "Authorize" a user so that the <code>["Authorize"]</code> Attributes recognize this user and allows them to access other Controllers/Actions. Here is how I have begun to set this up, but I can't find any direction on where to take it from here.</p>
  
  <pre><code>public class LoginController : Controller
  {
      // GET: /&lt;controller&gt;/
      //[Route("/Login")]
      public ActionResult Index()
      {
          return View();
      }
  
      public bool Login(Workflow.Models.WorkflowContext wfc, string username, string password)
      {
          var user = wfc.User.Where(u =&gt; u.Active &amp;&amp; u.Username == username &amp;&amp; u.Password == password).ToList();
          if (user.Count &gt; 0)
          {               
              //User may log in
              return true;
          }
          else
              //Access Denied
              return false;
      }
  }
  </code></pre>
  
  <p>For instance, without a user being authorized, I do not want them to be able to reach my "Home Controller":</p>
  
  <pre><code>[Authorize]
  public class HomeController : Controller
  { 
      [Route("/Home")]
      public ActionResult Index()
      {
          return View();
      }
  
      public ActionResult About()
      {
          ViewData["Message"] = "Your application description page.";
  
          return View();
      }
  
      public ActionResult Contact()
      {
          ViewData["Message"] = "Your contact page.";
  
          return View();
      }
  
      public ActionResult Error()
      {
          return View();
      }
  }
  </code></pre>
  
  <p>I have been hearing about the classes "Identity" and "SignInManager" and I am a bit overwhelmed on how to use either of those options.  I am still somewhat new to ASP .Net MVC, so I am trying to get a grasp on how Authorization works.  Thanks.</p>