401 Client Error: Unauthorized for url

If this is just something for your own use, what you can do is use the Auth Code flow, go to the URL on Twitch, and when you accept the scopes you’ll be redirected to localhost (which will just 404 if you’re not running a server) but you can still copy the code that is in the URL bar of your browser.

With that code you can continue the rest of the auth process where you exchange that code for a User Access Token and a Refresh Token.