Hi everyone! I am currently trying to get an OAuth token to allow my bot to read any channel point redemptions so that I may automatically process custom channel point rewards.
I am using HTTPS to get the OAuth and ws to connect to pub/sub
HTTPS is currently not getting me the token in its response. I can however manually put it in a browser and it will show up for me in the URL (but I need to log in first).
WS is working properly with pub/sub so far, I can ping, and get a pong, but obviously I get stuck at the LISTEN type that requires an OAuth key
I’ve put my code in a hastebin to not pollute the post (hopefully this is allowed, if not feel free to delete the post and I’ll re-post it with the code directly in here) https://hastebin.com/cocineniko.js
Part of me is worrying that I’m going about it the wrong way / going off track for what my goal is. Any help would be greatly appreciated. (I’ve seen other posts about this topic, but I couldn’t pull any information that I could use out of them.)
You have to manually follow the link to get a token. You can’t use fetch to get a user token the first time. That is the whole point of oauth is it makes the user manually authorize your apps usage. Once you get the token if you use the authorization flow you can refresh it programmatically.
Hey Barry, I just tried using the sample and it puts me right back where I’m at right now except with an extra html file. I get an error cant connect page on my browser, and the auth token in the url. I’m lost on how to actually get this auth token as a response so that I may use it.
Yeah you would do that for implict auth, but every 60 days you will need to go thru the auth flow all over again, as you didn’t get a refresh token to use to automate getting a new token