I am developing a PHP application which would use Google Fusion Tables only as a database in the background. The application includes a simple login section for basic security.
I downloaded the google-api-php-client and successfully built up a connection to my Fusion Table using oAuth. Thats fine. However, I want to get rid off the prompt screen, that says that my registered application want to access Fusion Tables and asks me to allow or disallow.
Since the app would use a Fusion Table being hosted on my account, I think there is no need to ask this question from the user.
Can you advise me any workaround to this? I plan to keep it as simple as possible, and would be really happy if there would be a way to get the authentication done without prompting the user with any additional screens.
Thanks so much for your help!
https://developers.google.com/fusiontables/docs/articles/oauthfusiontables
The OAuth prompt you describe is needed if you want to access a users Fusion Table, so you basically ask the user for access to his account so you can use it to create tables and stores/retrieve data.
But in your case you want to give your users access to your Fusion Tables that you created with your account. Google introduced for this use case so called Service Accounts.
All you have to do is:
- create a Service Account (you can do this in the Google API console -> "Access API")
- download the private key
- give the Service Account access to you table (click on the "Share" button in the Fusion Tables web UI)
- use the Service Account in your code to access Fusion Tables
Some time ago I created a simple UPDATE example using a Service Account.
Also, if you really do not need the sharing, visualization and publishing features of Fusion Tables, and just need a cloud database, consider using Google Cloud SQL which is designed for that usage.
https://developers.google.com/cloud-sql/docs/introduction