OAuth not working


#1

Hi guys,
hope this is the right section.

I want to develop a simple script that is able to cycle on a certain number of channels that I select (for example I gave to him a list) and I want him to give me back the follower’s number. So if I give him a,b,c,d he give me back
a followers: 15000
b followers: 20000

I have created the application on the dev console and get my client ID.
I am using a python library which is called python-twitch-client to interact with twitch and for some functions I need to generate an OAuth token.

How can I generate it?
Because I tried with this https://twitchapps.com/tokengen/# but after clicking continue, it brings me to localhost since I have set http://localhost in the OAUth redirect.
Is this correct?
So how do I get my OAuth so that I can continue?

Thanks guys


#2

No,
The site your using sets the redirect_uri to https://twitchapps.com/tokengen/ and not http://localhost
That will cause a ‘Parameter redirect_uri does not match registered URI’ error
Update the redirect_uri parameter in the url and after Authorization page you will be redirected to http://localhost and find the access token in the url bar


#3

Thanks, that’s clear!
I cannot modify that parameter on the website.
But I can on my app on TwitchDev account.

So, I modified localhost with: https://twitchapps.com/tokengen/
Because the website redirects here.

I authorize and what I get is:
{“status”:401,“message”:“invalid csrf token”}

What am I doing wrong?


#4

its working perfectly fine for me.
you might as well follow this page start at “To get a access-token”, skip the steps you’ve already done and the last step


#5

Well,
I do the following:

Paste this url to browser

https://id.twitch.tv/oauth2/authorize?client_id=YOUR-CLIENT-ID&redirect_uri=http://localhost&response_type=code&scope=SCOPES

I remove YOUR-CLIENT-ID and insert mine
I remove SCOPES and live it blank

I press ENTER, i authenticate and then I get:
{“status”:401,“message”:“invalid csrf token”}

Also if I insert something like user:edit instead of SCOPES, I get the same error.

Any suggestion?


#6

You don’t need an oAuth’ed scoped key for what you have described as wanting to do. Follow counts are public information

A ClientID will suffice.

This is a temporary issue and means you browser session is borked up usually.


#7

Hi Barry,
thanks for the answer.

It seems very strange to mee, I tried from Chrome on Windows and it does this, but also from Chrome on Mac and from Safari on Mac.
Are you sure is it a browser issue?

By the way is not clear to me how to get the follower count for a channel. Any suggestion?


#8

Yes


#9

Solved it, thanks!