Repository for the source that sits on https://twitchtokengenerator.com
Switch branches/tags
Nothing to show
Clone or download
Latest commit 2ad9de0 Nov 18, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api latest code Nov 18, 2018
assets latest code Nov 18, 2018
cron latest code Nov 18, 2018
forgot latest code Nov 18, 2018
img anti spam measures Jun 4, 2018
quick Bug fixes and feature additions. Apr 9, 2018
request Bug fixes and feature additions. Apr 9, 2018
stats Bug fixes and feature additions. Apr 9, 2018
.htaccess Adds db code and new features. See a security hole? let me know pls :) Sep 19, 2017
README.md latest code Nov 18, 2018
dao.php latest code Nov 18, 2018
index.php latest code Nov 18, 2018
internal.php latest code Nov 18, 2018
twitchtv.php latest code Nov 18, 2018

README.md

TwitchTokenGenerator.com

https://twitchtokengenerator.com

Image of site

Overview

A simple tool to generate access tokens for Twitch with custom scopes. Good tool for testing various Twitch third party tools (like swiftyspiffy/TwitchLib).

API

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:

  1. Ping the create endpoint to get a link to give to user:
  • Create Endpoint: https://twitchtokengenerator.com/api/create

  • Required Rarameters:

    • base64 encoded application title

    • scope list with + delimiter

  • Example create: https://twitchtokengenerator.com/api/create/QXV0aEZsb3dFeGFtcGxlIFRlc3QgQXBwbGljYXRpb24=/chat_login+user_read

  1. 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.
  2. 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.
  • Status endpoint: https://twitchtokengenerator.com/api/status

  • Required Parameters:

    • Id of auth flow
  • Example status: https://twitchtokengenerator.com/api/status/rtotgzqct6ro6nwlwr04

  • Please record your access token as well as the refresh token for usage.

  1. 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: https://twitchtokengenerator.com/api/refresh/{refresh_token}

License

MIT License. © 2018 Cole