When trying to log into Microsoft, it returns "Invalid request. Request is malformed or invalid." (AADSTS9002313)

This error message usually occurs when the request is not properly formatted or is invalid. It could be due to a number of reasons such as incorrect credentials, incorrect URL or parameters, or an expired token.

Couldn't exchange OAuth code for a Microsoft refresh token. Provider error: invalid_grant, error description: AADSTS9002313: Invalid request. Request is malformed or invalid. Trace ID: <TRACE_ID> Correlation ID: <CORRELATION_ID> Timestamp: <TIMESTAMP>, error status code: 400


Endpoint / Log: 

  • Returns during authentication flow, Auth Logs, and application API logs found on the Nylas Dashboard



  •  Some information in the authentication proposal was incorrect.


  • Check your credentials and ensure that they are correct.
  • Check the URL and parameters you are using.
  • Ensure that your token has not expired.
  • Try clearing your browser cache and cookies.
  • Try using a private session or incognito window.
  • Ensure to start the authentication flow from the beginning each time as each proposal is unique. If you bookmark the login page, make sure it doesn't contain any proposal ids.
  • Try using a different browser.




Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.