I'm accessing a Google Docs Spreadsheet for *only *reading the values. The command line quickstart.php <https://developers.google.com/sheets/api/quickstart/php> code ensures that the user only has to give the authorization only *once (*This is what I want in my web application*)*. However, this code only works via command line interface.
For my web application, I wrote these 2 files (index.php and oauth2callback.php) with the help of this <https://developers.google.com/api-client-library/php/auth/web-app> link in the documentation for OAuth 2.0. *MAIN PROBLEM: *The code provided in the documentation for index.php and oauth2callback.php needs authorization *everytime *user accesses index.php (I think that this is because the access token expires). Is it possible that the user only has to provide the authorization once just like the command line PHP code? How can I use the $client->setAccessType("offline"); to request authorization only once? I have attached my files (index.php, oauth2callback.php and quickstart.php) -- You received this message because you are subscribed to the Google Groups "Google Spreadsheets API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
<<attachment: quickstart.php>>
<<attachment: index.php>>
<<attachment: oauth2callback.php>>
