while writing this, I was able to get my token! I will explain in my next post below…I hopefully I can add pictures??
I am leave my post below for Barry as I want him to know where I was coming from. I thank him so much man! (also sorry if it sounds rude. I am not trying to be or anything, its just some of it didn’t make sense so I wanted to elaborate. Not like it matters now as I think I have my token.
I don’t know how to qoute Barry so I am going to just copy and paste to answer him because I don’t think we are on the same page:
Barry, you said -
“This website uses it’s own clientID and secret to create a token. You cannot use it, using YOUR clientID”
That doesn’t make sense. The website: (Twitch OAuth Token Generator) says specifically to, " You will need to first register an application in your Twitch account settings to obtain a Client ID and enter the Redirect URL below.
Client IDScopes List of available scopesRedirect URL: https://twitchapps.com/tokengen/
This application uses the implicit grant flow for the Twitch API to retrieve your token. This means that your token is only ever visible to your browser and not our server."
So you saying, “This website uses it’s own clientID and secret to create a token. You cannot use it, using YOUR clientID” doesn’t make sense when it says, " You will need to first register an application in your Twitch account settings to obtain a Client ID and enter the Redirect URL below."
Does what I wrote explain why I am confused as to what you are saying regrading that?
Here is another thing you said, " As you must write the code to exchange the code for a token (when using OAuth Authorization Code Flow as documented"
I already did that man! Infact, that was the first thing I tried before someone from the Discord gave me the token link. Here is my exact code word for word in python
"import requests
params = (
(‘client_id’, ‘izbr3e0woto5nlw13belle04zsrtvf’),
(‘redirect_uri’, ‘http://localhost:3030’),
)
response = requests.get(‘https://id.twitch.tv/oauth2/authorize’, params=params)
"
The problem is I don’t get any reply back run it. It just runs, then goes to the next line without giving me anything. THAT IS WHY I tried the oauth token link which I thought would be used to give myself a token if I put in the localhost:3000 as my redirect link for my app.
Does that make sense? I tried writing code and I got no errors back for me to know where the issue is, so I went to try it graphically.
Now mind you, if I put in “requests.get(‘https://id.twitch.tv/oauth2/authorize?client_id=izbr3e0woto5nlw13belle04zsrtvf&redirect_uri=http://localhost:3000’)” It will give me a response of 200 which means it saw it my http request. However when I tried to write code to pull back my token (as you saw my python code above) nothing came out of my IDE 3.7. It just went to the next line and didn’t give me a response. Maybe the code itself is off?
Another thing I noticed you posted, “Again Discord is giving you a bot login token for running a bot, it’s not really a oAuth token”
I apologize as I must have missed you saying that first time because I don’t remember that. If that is the case, then its makes sense why this is hard; there has been no time before this that I ever needed Oauth and I am pretty sure the OP is the same. There should be a note under the redirect URL that says to put local host if you are making the app for just yourself. (Then again, that still wont help noobs like myself if they are using local host for there ftp server)
One other very important post you gave me is this," If you already have a webserver running on localhost, and haven’t set it up to handle the OAuth process, then yeah it likely wont work as you’re doing other stuff on that port, so use a different one, for example http://localhost:3000 1 and try again.
You should get redirected back to that URL with various querystring parameters in the URL depending on what auth flow you used, eg,
http://localhost:3000?code=394a8bc98028f39660e53025de824134fb46313&scope=viewing_activity_read&state=c3ab8aa609ea11e793ae92361f002671"
I tried port 3000 and it didn’t give me anything but I will explain a little better.
I tried putting http:localhost:3000 in my python code so it came out like, "
import requests
params = (
(‘client_id’, ‘izbr3e0woto5nlw13belle04zsrtvf’),
(‘redirect_uri’, ‘http://localhost:3000’),
)
response = requests.get(‘https://id.twitch.tv/oauth2/authorize’, params=params)
"
However that didn’t give me any reply back from IDE 3.7. It just went to another line like I mentioned above. I know my python works because as I mentioned earler the get request came back with a 200 rsponse so I know it works…I think my code is off maybe but it wont give me any errors for me to figure out where to go from there.
I also tried putting http://localhost:300 in the redirect URL on my app and tried using the token link Twitch OAuth Token Generator to try and give me a token (thinking it was going to give a token in the address link or something.) and nothing came up. while typing this I think I figure out my stupid issue. I will post it in a separate post so that the OP can know what I did.
That whole information above was for Barry. I wanted to make sure he knew I was trying and wasn’t just ignoring him. He is so freaking helpful even though I am a noob and am probably frustrating. Still he has been patient and still answers even though its redundant. Thank you
Before I start again I did read this:
Yeah, I understand where you are coming from but I felt I had to do that. I had to force myself to keep asking everywhere I could because this is that important to me. So much so that I was willing to pay someone to give me my token just so I can work pas this. I NEED a channel update script and I would have paid for one if it exists. The fact that there isn’t one on github I can just use means I need to step up my game and learn a bunch of stuff in programming that I don’t normally come across. I knew importing and modules already but I never used Oauth in anything before so I just kept getting stumped.
BarryCarlyon (awesome person) Kept trying to help but none of it makes sense and I just randomly stumbled upon my token as I am such the idiot.
Also (as a side note) I am going to post what I said on the Discord developer channel when someone told me to go back to the basics of programming::
"Learning recursion doesn’t help with oauth
learning programming doesn’t help with making a twitch program api, the two things are just different. Learning the basics of programming doesn’t show how to use any of the api for twitch or oauth. You have to learn those specific things. The only way I would have came across this is if I needed to use Oauth for another website and they didn’t give me a link. Like I mentioned a day or two ago, Discord had a link for the token which made this alot easier. Its not like I had to learn the ful basics of a programming language to get my discord chat bot up and running and that is point there.
I have already done every single lesson in code academy for python. Does that mean I am going to know APIs, or Oauth? No way! That is the point, I have to go in head first and not know shit, till it starts making sense. If it was easier, I don’t think I would have posted in here or on the twitch dev forums so much these last couple of days.
I have been working on my twitch for months and have been learning batch scripts for OBS and VLC, python scripts for my instagram , twitter and discord, and so far everything has been good for learning. Some stuff is fustrating but nothing a good google search and some determination can’t solve. (plus common sense and the will to learn).
However twitch has been kicking my ass super tuff. I am embarrassed to say that I have a network certification after dealing with this crud… lol!"
My quote above is the reason I kept bothering this forum. I can spends days learning about programming which I did daily anyway However, I have NEVER came across OAuth. Me understanding programming and me understanding Oauth are two different things. Its like, you can understand how to make a program without knowing Oauth at all and that shouldn’t stop me from making my script."
I will say this, if I do learn Oauth to a very good degree I am going to make a video tutorial that is very slow and graphical for ANYONE to atleast understand the concept of it so when they go back to there programming language of choice, they can just go from there. (atleast I hope I can teach that good. hahaha)