justintv / Twitch-API

A home for details about our API
www.twitch.tv
1.72k stars 379 forks source link

Refresh tokens? #325

Open rbozan opened 9 years ago

rbozan commented 9 years ago

How would I use them? I couldn't find anything about it in the docs.

scagood commented 9 years ago

What are you trying to do? Do you mean an oauth token? I have never heard of a refresh token myself.

bashtech commented 9 years ago

Twitch does not automatically expire access tokens so refresh tokens are not as necessary as some other services. Normally an access token would expire after short amount of time for security and further requests would first need to be re-authenticated again with your client ID and secret to get an updated token.

Ex of refresh token flow:

POST https://api.twitch.tv/kraken/oauth2/token

 POST Body (URL-encoded)

    client_id=[your client ID]
    &client_secret=[your client secret]
    &grant_type=refresh_token
    &refresh_token=[refresh token from your original request]
rbozan commented 9 years ago

This doesn't answer my question. I mean, what does it do? With which calls can I use this refresh token?

bashtech commented 9 years ago

Give this a read: http://stackoverflow.com/questions/3487991/why-does-oauth-v2-have-both-access-and-refresh-tokens

Twitch does not expire access tokens (at this time) so there is little benefit to using it with Kraken.

On Sun, Feb 22, 2015 at 5:02 PM, youssefdetovernickr < notifications@github.com> wrote:

This doesn't answer my question. I mean, what does it do? With which calls can I use this refresh token?

— Reply to this email directly or view it on GitHub https://github.com/justintv/Twitch-API/issues/325#issuecomment-75465501.