Query string with "Login with twitch"

I am trying to implement a login with twitch feature for my website. Using:

a href = “https://api.twitch.tv/kraken/oauth2/authorize?response_type=code&client_id=[my id]&redirect_uri=http://127.0.0.1:8000&scope=user_read”>Connect Twitch /a

I am able have users grant my app access, however; I was wondering what Twitch returns when it redirects users back to my website. The ‘Code’ part of the query string. This code changes every time, even if its the same user clicking my " Connect Twitch" button

Example URL returned to my site:

http://127.0.0.1:8000/?code=l3ivsd2mnsdflom2359j&scope=user_read

As per the oAuth dance. The code is unique every time

You need to exchange the code for an oAuth token

Step 3:

1 Like

In addition to what BarrayCarlon said:

Once you exchanged the “code” for the actual “OAuth2” token, you might want to fetch some basic user information like the Twitch user ID and/or the EMail to be able to uniquely identify the user based on those details.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.