A simple tool to generate access tokens for Twitch with custom scopes. Good tool for testing various Twitch third party tools (like swiftyspiffy/TwitchLib).
- Full Site: twitchtokengenerator.com
An API exists on TwitchTokenGenerator allowing the creation of tokens and implementation in applications. The API is currently implemented in TwitchLib. A flow of how the API works is listed below:
- Ping the create endpoint to get a link to give to user:
base64 encoded application title
scope list with + delimiter
- Response will be a json object including success bool, an id, and a message string containing the auth url. Present the URL to the program user.
- Your application should ping the status endpoint for updates on authorization. The status will return error 3 "Not authorized yet" until the user authorizes their account. After authorization, the status endpoint will return their credentials on the first ping post-authorization. Additional pings will return error 4 "API instance has already expired". This is to protect the user.
- Id of auth flow
Please record your access token as well as the refresh token for usage.
- Occasionally you will find that your Twitch access token has expired. This is new as of Twitch's oAuth2 implementation. To refresh, use the "refresh" token that you received in step 3 and hit the /api/refresh/ endpoint to get a new token.
- Example refresh:
MIT License. © 2018 Cole