1

When authenticating a user on the website I get an access token

{
"access_token": "ya29.igD5RcTYjTQgJwGL_LFB7HFeWOZvGWTTO8JWpqGNaMOuMssswynugEea",
"token_type": "Bearer",
"expires_in": 3600,
"created": 1411545943
}

My problem is this will expire in one hour and I need to upload files in background using a cron job, this could be a week later. Is there a method to either get a token that will never expire or perhaps something I haven't considered?

slash197
  • 9,028
  • 6
  • 41
  • 70

1 Answers1

0

You can get refresh tokens, check the docs at

https://developers.google.com/accounts/docs/OAuth2.

adgelbfish
  • 354
  • 2
  • 15
  • Thanks for the heads up. Using the php sdk `getRefreshToken()` returns `null` though so how does this help me? – slash197 Sep 24 '14 at 09:56
  • check this out http://stackoverflow.com/questions/9241213/how-to-refresh-token-with-google-api-client. The refresh token comes with the first token. – adgelbfish Sep 24 '14 at 10:10