maweki / twitchlive-extension

TwitchLive-Panel Gnome Shell Extension displaying your favorite streamers
GNU General Public License v3.0
38 stars 8 forks source link

We now need an OAuth-Token #66

Closed maweki closed 4 years ago

maweki commented 4 years ago

This sucks and is probably not an easy fix

$ curl -H "Client-ID: 4yzkpoa13a9zqepwguxejohaqulrgbu" https://api.twitch.tv/helix/users?id=maweki
{"error":"Unauthorized","status":401,"message":"OAuth token is missing"}
maweki commented 4 years ago

I have kinda an idea on how to get this working.

maweki commented 4 years ago

So, apparently something is working again. But I have a crazy idea how we're gonne fix this, when it's broken again.

maweki commented 4 years ago

I "implemented" Oauth in a roundabout way which is surely not what anybody ever intended, but whatever. We open a browser and a python webserver that receives the response url as an url fragment, which we use in a page to make a user click (redirect later?) a button that sends the token to the same webserver that then writes the token into a file and closes itself.

Please, anybody try! It seems to work for me.

Nibbler999 commented 4 years ago

Works for me :+1:

maweki commented 4 years ago

If i've read all the twitch developer communications correctly, OAuth-tokens will be necessary for the API starting sometimes next week. I've added error reporting in the panel and I didn't authenticate for some of my machines. We will see then, if and how it breaks.

As far as I have seen, the token will need to be renewed every 60 days and there is no way to do this automatically, because we have a special kind of token that does not use a client_secret, which we wouldn't be allowed to distribute.

Looking forward to close all the issues around APIs and tokens.

maweki commented 4 years ago

Okay, it didn't quite work but now I fixed it.

maweki commented 4 years ago

This is fixed and works now. :)