0

is there a way to get longer token expiration time, or some kind of "permanent" token for client application ( Similarily as in DropBox API's)

SInce there seems to be problems with resumable upload to google drive when token expires, this could help in this situation ?

or is there just a way to define the token validity time to be bigger than 1 hour

br. Jarno

1 Answers1

2

No accessTokens are only good for 1 hour. But you have a refreshToken that was returned along with your accessToken. You can use that to get a new AccessToken when the first one has expired.

Options:

  • Test either the expire time to see if its getting close to expireing and get a new one before it expires.
  • Wait until you get the error that says it has expired. Then request a new AccessToken

Personaly I like to get a new one 5 minutes before my AccessToken expires then I avoid an error from the google servers.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
  • Yeps, thanks . That's what I have been doing already , renewing tokens, but why I asked about this was following issue with resumable_uploading: http://stackoverflow.com/questions/21301499/google-drive-sdk-c-rest-api-resumable-upload – Jarno Lavikonmäki Jan 27 '14 at 10:28