OAuth Authorization Code Issue: Invalid Grant Error

After receiving the authorization code, when I make a request to generate the token, I encounter the following error:
“error”: “invalid_grant”,
“error_uri”: “Build an app with Asana”,
“error_description”: “The code provided was invalid.”
Despite using a newly generated authorization code for each attempt, the error persists. Below are the details of my POST request:

  • POST URL: https://app.asana.com/-/oauth_token
  • Data (form-encoded):
    • grant_type: authorization_code
    • client_id: 120********
    • client_secret: 81e0*******
    • code: 2%2F1*****
    • redirect_uri: http://localhost:3001

I have followed all the steps as per the authentication documentation but keep facing the same issue.