You tried to “get”/fetch the URL rather than redirect the website user to the URL
Here is an example nodeJS user access generator using Express (for web serving) and Got (for web requests)
The general rule for oAuth is:
- construct a
<a href="to Twitch oAuth Entry - user clicks that link
- user goes to Twitch
- user accepts (or declines) the link
- user comes back to your REDIRECT_URI with a
?codein the parameters - you exchange the
?codefor an access token you can use
The linked example will do this and then perform a user lookup to get the user for that token