No the token is not generated fron the console.
A given application doesn’t auto grant rights to a users account.
There is no Token to find as it’s not there.
This is the oAuth flow in a nutshell:
- Create a webpage with a link as in
<a href="">Login With Twitch</a> - This will be a link to Twitch along the lines of:
https://id.twitch.tv/oauth2/authorize?client_id=CLIENTID&redirect_uri=URLENCODEDRETURLINK&response_type=code&scope=channel:read:subscriptions
- The user you want to read subscribers of will click this link
- The user is then asked if they wish to allow
CLIENTIDaccess to their account. - The user click yes/no
- If yes, the user is then rediredrect back to
RETURNLINKwith a?codein the URL - The webpage at
RETURNLINKthen will do a POST request to Twitch to exchange thatcodefor an access token (and a refresh token).
That access token can then be used to do sub data lookups. You will need to store the refresh token so you can get a new access token when the access token expires
This is a “one page” example in PHP that will do “regular/refreshable” User authentication that should serve as an example to build you own flow for this https://github.com/BarryCarlyon/twitch_misc/tree/main/authentication/user_access_generator/php
And example includes a script to maintain that token.
But you’ll need to determine where you store the token/refresh token for use and adjust accordingly.