Invalid request getting access token
- 6 years ago
I figured it out. I'll leave the solution here for users who may run into the same issue.
I used a very dodgy method of retrieving the code without a web socket, which was using a Chrome extension to modify headers of my access code request in order to log in (which requires browser). Then I got the code directly from Chrome's URL bar. This means the code is URL encoded, hence my invalid request. I decoded the URL and send the request again (with a similarly unencoded Redirect URI) and got the access token.
I had to do the "Chrome-based modified-header request" thing because I was only trying to log in as a developer, not using any web interface for users with a public facing URL that could be redirected to. Could not find any existing solution for it. It would help if MYOB support could chime in with a better solution to retrieving the code.