Need some help with auth tokens [TwitchLib]

OAuth 2.0 is an industry standard, so the Twitch documentation provides the step by step instructions on how to make the requests to their OAuth endpoints. If you wish to look more in depth, or for more generic guides on OAuth2, I suggest searching for it online as there is a wealth of information available as well as the official RFC for the specification.

It’s rare, but some endpoint return a wrong error reason when they are passed malformed data (such as trying to use a login in place of an id). Also if you’re using a library such as you are instead of making the API requests yourself there it could be the library is mistakenly displaying an error, or is an issue with that depending on if it passes you the error directly from Twitch or if it uses its own error messages.

You can use the Get Users, or Validate Token endpoints with your OAuth token, and it will return the user associated with that token, including their id.