title: 400 Bad Request error when simulating login with Postman on ASP.NET Core Web Application with individual user accounts stored in-app
body: <p>Postman returns a 400 Bad Request error when trying to simulate a login request to an ASP.NET Core Web Application that has an authentication of individual user accounts stored in-app.</p>
  
  <p>However, I am able to log in when using the default application template generated by Visual Studio. Using Chrome DevTools, it seems like the request is as follows:</p>
  
  <ul>
  <li>Request URL: <em>application</em>/Identity/Account/Login</li>
  <li>Request Method: POST</li>
  <li>Content-Type: application/x-www-form-urlencoded</li>
  <li>Form Data: 
  
  <ul>
  <li>Input.Email: <em>user's email address</em></li>
  <li>Input.Password: <em>user's password</em></li>
  <li>__RequestVerificationToken: <em>token</em></li>
  <li>Input.RememberMe: <em>user's selection of either true or false</em></li>
  </ul></li>
  </ul>
  
  <p>I have unsuccessfully tried to simulate this using Postman as follows: <a href="https://i.stack.imgur.com/GuVeL.png" rel="nofollow noreferrer">Postman request headers</a> and <a href="https://i.stack.imgur.com/P11Lc.png" rel="nofollow noreferrer">Postman request body</a></p>
  
  <p>Postman returns a 400 Bad Request error without any additional information: <a href="https://i.stack.imgur.com/RhLYB.png" rel="nofollow noreferrer">Postman response with 400 error code</a></p>
  
  <p>Please could you help me determine what is wrong in my request when attempting to simulate the login with Postman?</p>
  
  <p><strong>Edit:</strong> I did not write any custom code for this. It is the default template generated in Visual Studio. I tried looking for the function that gets called when I use the built-in login page</p>
  
  <p>When I add a scaffold "Identity" to the project using Visual Studio, the login page is named <em>Login.cshtml</em> and it uses the default LoginModel. When I tried to debug with a breakpoint, I see that it calls a function named <em>OnPostAsync</em> in the LoginModel class.</p>
  
  <p>However, when I use Postman, the breakpoint is not reached. Therefore, I think this may be because my current request structure is incorrect</p>