How to get a authentication token for a desktop app?

I have a desktop app that shows a list of streams and I included the ability to login. However, I do not know how to implement that. I registered my application on connections and I have a client id. I know how to add scopes to the url but I’m not sure what the redirect url is. I want my desktop app(in Python) to be able to have a user login and have them authorize it on the app? Is that possible? Maybe with a webview? Anyways, do i need a server to get a redirect url?

I need to write a tutorial explaining this.

The redirect URL is where the login page goes to when the login is successful or the user has abandoned (failed to many times or clicked cancel). The redirect URL will have the authtoken appended to it as a URL Param if the login succeeded.

In an app that can show a webview and get events about that webview (so most) the idea is to capture the redirect event to your specific url, read out the auth token from the url param and just close the view.

Does that make sense?

Hm… I think I understand it more. So For redirect URL should i just use (http://localhost)? When I use that, it gives me an auth token in the address bar. I am able to use https://api.twitch.tv/kraken?oauth_token= to get the user data. I’m just not sure if localhost is the right thing to use here. In my application, I would open a webview and then close it right after the user authorizes it. Also, I’m included user_subscriptions and user_follows_edit in the scope but I’m unable to get a list of the user’s channel that he or she is following and his or her subscriptions.

{“follows”:[],"_total":0,"_links":{“self”:“https://api.twitch.tv/kraken/channels/aksynial/follows?direction=DESC&limit=25&offset=0",“next”:"https://api.twitch.tv/kraken/channels/aksynial/follows?direction=DESC&limit=25&offset=25”}}

but I know this user has more than one channel that he is following.
Also, when I access the subscription link, https://api.twitch.tv/kraken/channels/aksynial/subscriptions, I get an error saying {“error”:“Unauthorized”,“status”:401,“message”:“Token invalid or missing required scope”} although I did put user_subscriptions in the scope. Am I supposed to add oauthtoken= at the end of the link?

I’ll leave the scope issues to the webby guys on here like Fugimon, as to the ‘localhost’ being wrong, if you have a webview it really doesn’t matter what the url is, as you are going to watch for that url, grab the authtoken and close the view so it will never actually complete the navigation part.

You need to send the oauth with every request that hits an endpoint that requires authentication. There are a couple ways to send it located here

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