401 Client Error: Unauthorized for url

That’s because you’ve put the redirect URI to https:/twitch.tv, which makes no sense. The redirect URI is where Twitch will send your browser after you accept or decline connecting your Twitch account to the app.

You’re getting a redirect mismatch because that redirect URI must match what you’ve set for your app in your TwitchDev console. If you’re just doing this locally, and want to do it as I’ve mentioned, just set your redirect URL in both the URL you’re going to, and in your app settings, as http://localhost/