Hi,
The same question was asked a year ago with no answer( No expires_in field in response while getting access token). But it was also before the new API has settled down, so maybe now the situation is more clear.
The documentation says:
New OAuth2 access tokens have expirations. Token-expiration periods vary in length, based on how the token was acquired. Tokens return an
expires_in
field indicating how long the token should last.
However, in response to this request:
curl -X POST https://id.twitch.tv/oauth2/token?client_id=<CLIENT-ID>&client_secret=<CLIENT-SECRET>&code=<CODE>&grant_type=authorization_code&redirect_uri=http://localhost:3000/bla
I’m getting
{
"access_token":<TOKEN>,
"refresh_token":<REFRESH-TOKEN>,
"scope":["user:read:email"],
"token_type":"bearer"
}
I wouldn’t care about this, but the OAuth lib in Ruby only exposes a refresh token if the expires_in
is present, so all I get is a short-lived access token.