Getting authorization token within url fragment

For PHP you really should not be using implicit auth. As a “server” cannot see the URL Fragment. Implicit auth is intended to be used for apps that don’t have a server.

You should use something like

  1. Redirect to Twitch
  2. They come back with a code
  3. Exchange the code for an access token
  4. ???
  5. Profit