I’ve been using the same Client ID for my application for a couple of months. This is Public type client that I control. I’ve been using it to make API calls such as retrieving a user and logging into chat via IRC. A couple days ago IRC login started returning “Login authentication failed”. Retrieving users now returns no results.
I started seeing this behavior at the same time on two different machines, each with their own OAuth access token. Both represent my user which has no issues accessing Twitch. Another user of my tool reports it’s not talking to Twitch chat. I’ve tried getting a new OAuth token for my user from the same Client ID; the token gets issued successfully but API/chat access doesn’t work from that new token.
The timing comes shortly after I made the repo with my code and client ID public. I think this may be a case of a scraper discovering the client ID and abusing it but I have no evidence of this. There’s nothing special showing in the dev dashboard for my application.
I created a new application with the same configuration (public client). I loaded the client ID in my program, generated a new oauth token for my user and everything works. I think this suggests the issue is with the existing client ID. If this is the case, it would be really nice if there was a way to discover this other than trial and error.
@BarryCarlyon I appreciate your fast and thorough response.
I’m now pretty confident my issue is purely token expiration. The tokens failing at the same time is probably coincidence of them being issued at about the same time with the software first supporting Twitch integration.
I didn’t realize that tokens issued through the implicit grant flow expire. The documentation of the response on issuance doesn’t include a refresh token or an expiration. The documentation for the implicit grant flow doesn’t mention expiration at all:
The lifetime of an access token depends on how you acquired the token. When you get a token, the expires_in field indicates how long, in seconds, the token is valid for.
Since there’s no expires_in in the implicit flow response, it’s pretty unclear.
I think the documentation could be improved here.
Now I need to figure out why I wasn’t getting an Unauthorized back from my library with expired tokens
Access and refresh tokens can become invalid for the following reasons:
Not required by the standard on implict auth so it doesn’t, it’s generally expected with such a token/oAuth method, that you’ll end the users session, and get a new token, before the token itself dies