The redirect URI would be the URI when your oAuth handler lives.
https://twitchapps.com/tokengen/ is not yours.
For this example, it’s designed to run in a browser
So the Redirect URI for testing this example is the URL to the page that you view the page at in a Web browser.
This example doesn’t use a index.php you sure you have the right files?
Yeah thise nice “login with twtich button” images are looooong gone…
This suggests you copy and pasted your ClientID wrong.