Pub Sub with fully server side authentification

Expiry is returned when the token is created.

{
  "access_token": "<user access token>",
  "refresh_token": "<refresh token>",
  "expires_in": <number of seconds until the token expires>,
  "scope": ["<your previously listed scope(s)>"],
  "token_type": "bearer"
}

You can also pass a token to the validate endpoint to check it’s expiry

The example response omits the field.

{
  "client_id":"SomeClient",
  "login":"SomeUser",
  "scopes":[arrayofscopes],
  "user_id":"SomeID",
  "expires_in":sometimeinseconds
}

A normal Twitch oAuth User Token is valid for four hours.

You can automate getting a new token using the supplied refresh token