0

I am confused about one thing here. I have a working page that is intended to read/write from/to a google fusion table. Now, I have this working... but it only works with the email address that I generated the Client_ID from on the Google Cloud Developer Console. I want this application to work with an arbitrary public user. I feel like it has something to do with the Email Address code that was generated with the Client ID for the "Client ID for web application" credential.

See the live version for reference. http://www.bneigher.com/FusionTable/

My code:

 // This is for authorizing the table for read (Top of page)
 gapi.auth.authorize({
                client_id: $scope.clientId,
                scope: $scope.scopes,
                immediate: $scope.immediate
                     }, handleAuthResult);

. . .

// This is when a POST is invoked to write
runClientRequest({
                    path: path,
                    body: body,
                    headers: {
                        'Authorization': 'Bearer ' + $scope.accessToken,
                        'Content-Type': 'application/x-www-form-urlencoded'
                    },
                    method: 'POST'
                }, callback('insert-data-output'));

What do I need to do to get this to work for... you, for example, to write to the table?

The full code for the logic can be found at http://www.bneigher.com/FusionTable/js/controller.js for reference.

Thanks guys

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
bneigher
  • 818
  • 4
  • 13
  • 24

1 Answers1

0

Google doesn't allow you to simply let anyone edit your table. It has a small tuto about collaborative data gathering (https://support.google.com/fusiontables/answer/2584135?hl=fr but it does not scale up (editing requires to have a google account and be specifically granted the right to edit the table by the owner).

What you will probably want to use instead is a "Service account". Authentication will then occur at the Service account level rather than at the user level. You can find more details in the answer to the following question: Upgrading to Google Fusion Tables to Google API V.1

Community
  • 1
  • 1
etna
  • 1,083
  • 7
  • 13