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?
How you get the query or search parameter depends on the HTTP server and/or library youâre using. Refer to the documentation for the library youâre using.
Can you suggest which library i can use to get the code?
For me its working fine is POSTMAN or in browser just want to know how I can get redirected url code link via Python
i reviewed it but what Iâm having issue is described below
authorize_url = âhttps://api.twitch.tv/kraken/oauth2/authorizeâ
client_id = âSomethingâ
RESPONSE_TYPE=code
SCOPE = âanalytics:read:gamesâ
COMPLETE_URL = authorize_url+â?client_id=â+client_id+â&redirect_uri=â+callback_uri+â&response_type=â+RESPONSE_TYPE+â&scope=â+SCOPE
print(COMPLETE_URL)
r = requests.head(url=COMPLETE_URL,allow_redirects=True)
print(r.url)
Step 1) Redirects you to Twitch.
Step 2) Accept or decline
Step 3) you come back with an access token or an error message
With regular oAuth, like what you are doing
Step 1) Redirects you to Twitch.
Step 2) Accept or decline
Step 3) user comes back with a ?code or an error message
Step 4) Exchange the ?code for an access and refresh token
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 "