App authentication on order to get access_token

Sounds like you are storing/recalling the code instead of the access token.

The code can be redeemed for an access token once.

You should then store the access token and use that for subsequent requests.

Auth flow is:

  • Generate Auth URL
  • Redirect User to Twitch
  • Twitch returns to callback url with code
  • Exchange code for access token
  • Store and use access token
2 Likes