title: PasswordSignInAsync MVC C#
body: <p>Good day, Please i am writing an MVC application that can only allow users sign in with three parameters which are ID,Email and password. My question is the PasswordSignInAsync has two major parameters Email and Password. How can i override it to allow ID as another parameter for the sign in.</p>
  
  <p>this is the normal code:</p>
  
  <pre><code>  [HttpPost]
      [AllowAnonymous]
      [ValidateAntiForgeryToken]
      public async Task&lt;ActionResult&gt; Login(LoginViewModel model, string returnUrl)
      {
          if (!ModelState.IsValid)
          {
              return View(model);
          }
  
          // This doesn't count login failures towards account lockout
          // To enable password failures to trigger account lockout, change to shouldLockout: true
          var result =  await SignInManager.PasswordSignInAsync(model.Email,model.Password, model.RememberMe, shouldLockout: false);
          switch (result)
          {
              case SignInStatus.Success:
                  return RedirectToAction("DealerDashboard", "Dealers");
              case SignInStatus.LockedOut:
                  return View("Lockout");
              case SignInStatus.RequiresVerification:
                  return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe });
              case SignInStatus.Failure:
              default:
                  ModelState.AddModelError("", "Invalid login attempt.");
                  return View(model);
          }
      }
  </code></pre>
  
  <p>//so in my solution i want to do this:</p>
  
  <pre><code>  [HttpPost]
      [AllowAnonymous]
      [ValidateAntiForgeryToken]
      public async Task&lt;ActionResult&gt; Login(LoginViewModel model, string returnUrl)
      {
          if (!ModelState.IsValid)
          {
              return View(model);
          }
  
          // This doesn't count login failures towards account lockout
          // To enable password failures to trigger account lockout, change to shouldLockout: true
          var result =  await SignInManager.PasswordSignInAsync(model.id,model.Email, model.Password, model.RememberMe, shouldLockout: false);
          switch (result)
          {
              case SignInStatus.Success:
                  return RedirectToAction("DealerDashboard", "Dealers");
              case SignInStatus.LockedOut:
                  return View("Lockout");
              case SignInStatus.RequiresVerification:
                  return RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe });
              case SignInStatus.Failure:
              default:
                  ModelState.AddModelError("", "Invalid login attempt.");
                  return View(model);
          }
      }
  </code></pre>