What do I do for OAuth redirect URL when registering a chat bot?

I figure I probably need something for OAuth so that the program can log into my bot’s account, but I’m very very new to how OAuth works and am having a hard time understanding things like OAuth redirect URLs, and whether I even need one or if I can just make it localhost if this bot account’s the only thing it’s going to log into.
Thanks all.

The oAuth redirect URL will be the sever/page/script URL that process the Step 2/3 of regular user oAuth

The code that exchanges the ?code for an access and refresh token.

You’ll need to get a new token for your account every now and again (and the first time) if the key is invalidated for some reason. So having an easy way to give the bot new credentials is a good idea.

Sure localhost works but then that means the key exchange stuff lives on your computer and if you need to give the bot new keys whilst not at home, you are stuck with a non working bot!

Sorry, I’m like, really really new to all of this, but how do I get my account to authorize the bot? For the time being I think I’ll just use localhost and figure something else out down the road since this is more just a learning project than an actual bot I plan to regularly use.

A bot account is just a regular Twitch account.

So register a second Twitch account.

I’m really sorry, I probably am asking dumb questions, but what I’m asking is, how do I make this second account authorize it? From my understanding I go to the redirect URL or something, so for example if I wanted to make localhost that redirect, how do I set up localhost such that I can authorize the bot from there? Is there a good video or guide or something out there that’ll go into setting that stuff up?

You create a website
You send the user to the website
The user clicks “sign in with Twitch”
The user is sent to twitch
The user checks they are logged into the right twitch account and accepts or declines the link
The user comes back to your site with a ?code
Exchange the ?code for an access token/refresh token

For example I could say “hey I need an access token from you please visit my website Twitch Implicit Auth Example to provide this”

And away we go.

This is a link to the implicit oAuth flow. Which differs from the flow described above. But should illistrate what I mean by a “website” and the oAuth loop.

There is also a farily extension guide with some Twitch Specific stuff for oAuth here Authenticating with the Twitch API

But this is just industry standard oAuth. Once you know how it works you can get tokens for a lot of different services jsut feed it different URL’s

1 Like

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