Re: Twitch.tv API OAuth2 token authorization

1,002 views
Skip to first unread message

doubl...@gmail.com

unread,
Aug 26, 2012, 3:59:39 PM8/26/12
to justintv-ap...@googlegroups.com
On Saturday, August 25, 2012 10:36:09 AM UTC-7, Alexander Popov wrote:
> I'm trying to authorize to Twitch.tv API using oauth2.
>
>
> I redirect user to login page (/kraken/oauth2/authorize), specifying callback. He returns to me with 'code' in parameters.. what should i do next?
> As far as i concern, i need to post this code somewhere and get oauth2 token but haven't found url in API documentation.

Are you specifying "?response_type=token" ? After authorizing, the user will be returned to you with an access_token (oauth token) in the document fragment (doc fragments are not sent to servers as part of the GET request, so you'll have to use JavaScript to check window.location and pull it out)

Alexander Popov

unread,
Aug 27, 2012, 12:45:44 PM8/27/12
to justintv-ap...@googlegroups.com, doubl...@gmail.com
Does Twitch.tv API support "code authorization"? (http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-4.1)

It's a web-application using Twitch.tv where i would like user to bind his Twitch.tv account to account in application on a long-term basis.
And i'd like authorization logic to be server-side.
I managed to retrieve the code but i couldn't find URL to send "access token request" to. (section 4.1.3 of the link above).

воскресенье, 26 августа 2012 г., 23:59:39 UTC+4 пользователь doubl...@gmail.com написал:

James Richard

unread,
Aug 27, 2012, 4:53:16 PM8/27/12
to justintv-ap...@googlegroups.com, doubl...@gmail.com
No, we don't support code auth at the moment. Access tokens don't expire unless the user explicitly revokes your permissions, so you can use it long-term. If you send the token to your app from the callback page, you can do all your auth server-side.
Reply all
Reply to author
Forward
0 new messages