OAuth authorization code flow isnt working

This is step 3 of oAuth

You are supposed to make a HTTP POST request to this URL, your 404 Error suggests you made a HTTP GET request instead

PHP Example: https://github.com/BarryCarlyon/twitch_misc/blob/master/authentication/user_access_generator/php/index.php#L38
NodeJS Example: https://github.com/BarryCarlyon/twitch_misc/blob/master/authentication/user_access_generator/nodejs/server.js#L127