For OAuth Authorization Code Flow this is the process which I found from documentation and one of the posts.
Step 1 - send user to loginRedirectURL https://id.twitch.tv/oauth2/authorize
where I accepted/authorized the connection
Step 2 - user is sent to your redirectURI with a code https://<your registered redirect URI>/?code=<authorization code>
Step 3 -you exchange the code for a token, aka tokenExchangeURL https://id.twitch.tv/oauth2/token
Here my question is how do we get code in step 2 programmatically?
Is there any specific library? I was thinking of using python requests or urllib library?
i reviewed it but what I’m having issue is described below
authorize_url = “https://api.twitch.tv/kraken/oauth2/authorize”
client_id = “Something”
SCOPE = “analytics:read:games”
COMPLETE_URL = authorize_url+"?client_id="+client_id+"&redirect_uri="+callback_uri+"&response_type="+RESPONSE_TYPE+"&scope="+SCOPE
r = requests.head(url=COMPLETE_URL,allow_redirects=True)
Your Python website presents a link for users to click on
users click the link and are taken to Twitch
users accept/decline the apps access
user comes back to your python website with a ?code or error message
you exchange the ?code for an access token/refresh token
I’m using TWITCH API for some data collection and was thinking if I can do everything automatically by parsing and no manual efforts but looks like from what you’re saying some server side programming or “webistey” would be required
Still I need to use Client-Credentials? In Client credentials I’m able to do Post Command and retrieve Access Token but that access token cannot be used in “Get Game analytics” pipeline it then throws an error 401. -"Missing User Authentication "