Reputation: 2530
I have been holding off on implementing oAuth on my service, but i'm getting a bit behind so I need to start implementing this system. And I am using a script from
http://www.phpclasses.org/package/7700-PHP-Authorize-and-access-APIs-using-OAuth.html
And I seem to get a successful response with a Token... Response:
Access token: ya29.1..................etc
Access token secret: [null]
Access token expiry: 2014-01-29 19:16:31 UTC
My confusion is that the token expires in a few hours... Will my user have to 'login' every time to google when they use the service?
My service runs a cron job every night that queries google to find if we need to sync any items (Tasks)....
Is it possible to use this? I'm a bit confused on HOW to use the oAuth token to make calls on their behalf...
Perhaps someone can shed some light on my issues. Any guidance is appreciated.
Upvotes: 1
Views: 237
Reputation: 1245
Google OAuth tokens expire after a while if you do not request it for using the Google API offline.
That PHP OAuth class makes it simple just by setting the offline variable to true. That is explained in more detail in the article of the OAuth class blog.
I am the author of that class, but I am not monitoring here. In the future, if you have specific questions about that class, please use the respective support forum, so I can be notified and reply to you quickier.
Upvotes: 1