stopthatrightmeow / Mod-erate-Impact

A Twitch Mod Chat Tracker
GNU General Public License v3.0
1 stars 0 forks source link

Feature Request - Twitch Refresh Tokens #6

Open teak opened 2 years ago

teak commented 2 years ago

Twitch user auth tokens are only valid for a few hours, but are only needed during the initial connection to IRC.

Would like to be able to provide a refresh token in the config that would be used to get a new auth token when connecting/reconnecting to IRC.

This would use the "Authorization code grant flow" documented here, but would only need to implement refreshing tokens, documented here. BarryCarlyon has a good breakdown with some extra details here.

stopthatrightmeow commented 2 years ago

I'll take a look at this, thank you for the information associated it looks like it won't be too hard to add!

stopthatrightmeow commented 2 years ago

Ok turns out it's a little bit harder to implement than I had originally thought! That being said Kian Ryan seemed to have figured it out so I'll just implement it in Flask and go from there.

May I ask how your running it, are you using the executable or through Docker? I ask because in order to properly setup the instance with twitch for the OAuth you are required to use SSL certs, and I can build out Nginx reverse proxy with letsencrypt all in docker and that'd be an easy solution. Otherwise I'll look into other options.

teak commented 2 years ago

I host it on a tiny VPS just running the python script, but I tunnel it through Cloudflares Argo to make it available online. I believe that means out going https requests use cloudflares SSL, although I have never tested this.