Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't get this to run, which tokens do I need? #13

Open
Exceen opened this issue Sep 11, 2024 · 0 comments
Open

can't get this to run, which tokens do I need? #13

Exceen opened this issue Sep 11, 2024 · 0 comments

Comments

@Exceen
Copy link

Exceen commented Sep 11, 2024

hey, can you quickly point me to the right direction which tokens I need? I created an application on the twitch developers channel, tried to generate an access token by using my client-id and secret (https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/#authorization-code-grant-flow), but all I get is this response:

09/11/2024 22:02:20 [twitch_drops_notifier.twitch] [ERROR] Bad response: 401
09/11/2024 22:02:20 [twitch_drops_notifier.twitch] [DEBUG] Request : {'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate, br', 'Accept': '*/*', 'Connection': 'keep-alive', 'Authorization': 'OAuth cmo9gjyzjjzrs3am0djkjfple9cuh6', 'Content-Type': 'text/plain;charset=UTF-8', 'Content-Length': '175'} [{"operationName": "ViewerDropsDashboard", "extensions": {"persistedQuery": {"version": 1, "sha256Hash": "e8b98b52bbd7ccd37d0b671ad0d47be5238caa5bea637d2a65776175b4a23a64"}}}]
09/11/2024 22:02:20 [twitch_drops_notifier.twitch] [DEBUG] Response: {"error":"Unauthorized","status":401,"message":"The \"Authorization\" token is invalid."}

I'm requesting the oauth token this way:

url = f'https://id.twitch.tv/oauth2/token?client_id={client_id}&client_secret={client_secret}&grant_type=client_credentials'
response = requests.post(url)
access_token = response.json()['access_token']

apparently it's a wrong one? can you help me please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant