Get request with Oauth token instead of Bearer token

I am currently able to do a get request to “https://api.twitch.tv/helix/users?login=
using an app token + Bearer token in the “Authorization” and “Client-Id” headers.

However I would like to be able to do the same thing from a user generated token instead.
I’ve tried a lot of different methods to do so with a token generated from: Twitch Chat Password Generator
but it doesn’t seem to be working. I’m starting to lean towards the fact that I have to tie the token generation to the the Client-Id of my app…

I’ve been looking on the forum quite a bit I can’t seem to figure it out so any help would be appreciated!

Correct.

If you generated a token from a third party generator
Then you need to use the third party generators clientID

1 Like

I didn’t realize that website was considered third party.
I managed to get the Client-Id of that website through the web browser and it does work now
However I guess I should probably do it from my app directly… I’m going to try and figure that part out. Thanks a lot for helping! (instant reply too!)

Yeah either use the TwitchCLI or build your own website for generating tokens

The app i’m making is just an integrated chat within a game. I’m trying not to go too overboard with it and a tiny bit of diy like users having to generate a token using something like a third party website isn’t too big a deal.

Then you really need to do something like

  • user opens the game
  • user clicks on [link twitch]
  • web browser is laucnhed
  • user accepts/declines Twitch Connectiong
  • on accept, obtain token
  • relay token back to game

or if you need readonly access to chat, then you don’t need a token at all, jsut ask the user their channel name

I want users to be able to use the chat from within the game so read only isn’t it.
What you suggested would honestly be ideal but I’m super clueless on how the whole thing would work. (I’m not a developer to begin with, just doing this in my spare time)

You could potentially wait for the Game Engine Plugins to be made available in an Open Beta (or release) State which could cut down on your need to implement many things if you are using Unity or UE.

Otherwise, what Barry explained remains true and you’ll want to open a browser → user logs in → token gets relayed to game.

As an Example, I can provide my (no longer functional with the current game version) entry for the Channel Points Hackathon, which is a Mod for a Unity Game which follows the exact steps mentioned above. GitHub - Marenthyu/SCPI: BTD6 Streaming Channel Points Integration

More resources can also be found here: Authenticating with the Twitch API or on the Discord

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.