Step 1 redirect user to Twitch
Step 2 user accepts or declines the link between clientID and application
Step 3 user returns with a ?code in the URL params (or an error)
Step 4 Obtain the code from the URL and with a curl POST request get a token
This’ll depend on the langauge you are using.
- PHP will be
$_GET['code']https://github.com/BarryCarlyon/twitch_misc/blob/master/authentication/user_access_generator/php/index.php#L32 - nodeJS will be (for express)
req.query.codehttps://github.com/BarryCarlyon/twitch_misc/blob/master/authentication/user_access_generator/nodejs/server.js#L110
This only holds true if you are doing regular user authentication which is my assumption