What's a redirect URI?

I’m trying to figure out a way to upload videos to twitch but it says I can’t looking at it I need to register and authorize, to register I need a Redirect URI, and I have no idea what that is or how to find it?

The Redirect URI is whatever the URL of your web server handling the OAuth process is, it’s where the user going through the OAuth flow to grant you a token with permissions to access those endpoints is sent to after they accept or deny those permissions.

…wow this is complicated

The docs have a step by step guide: https://dev.twitch.tv/docs/authentication/getting-tokens-oauth

What it boils down to is you first send the user to a Twitch auth page asking for certain permissions.
The user then Accepts/denies those permissions and is sent back to your page
If you’re doing client-side API requests you’d use the Implicit flow and have an access token in the URL hash. If you’re making requests server-side you’d use the Auth Code flow and will have a ‘code’ querystring param, which your server can exchange for an access token and refresh token to get new tokens each time they expire.

If you’re just doing this for yourself, you can just use http://loclahost, which will 404 if you’re not running a web server but you can still copy the required bits out of the address bar on your browser. If you’re wanting other users to utilize your app you’d need to run a web server.

2 Likes