Method to obtain new/current oauth token for chat bot?


#1

Hi all,

I’ve developed a few small scale Twitch chat bots in java. They all share login information for the bots’ chat listener. I ran into an issue where the IRC authentication token expired or had been reset (it’s a separate account I created for the bot that is never touched). I’d like to put some code in place that would reach out to the Twitch server to obtain current/new OAuth token for the bot upon a failed login. Is there something in the API that I could call that would return that new value?


#2

You will want to look into refresh tokens to deal with access token expiration. You store the refresh token and use that to obtain a new access token when the old one expires.