usp
usp

Reputation: 797

How to allow users access[read/write] a private fusion-table using their Google accounts

I am using a Fusion table to store some geographical data. I want to allow users access[read/write] to this table using their Google accounts. Can anyone please let me know how to do this?

I tried using OAUTH2.0 [Used this as reference] and use client credentials to do this. But, it seems the table is created in the users' account rather than the admin account.

Upvotes: 3

Views: 1581

Answers (2)

amelvin
amelvin

Reputation: 9061

I know this questions a bit old, but I thought I'd offer an answer for further searchers.

Fundamentally Google Fusion can be used as a private database accessed via a Google Apps Service Account tied into Google Apps Business Account.

SERVICE ACCOUNT: Create an app & go to https://console.developers.google.com/project/[appname]/permissions & give your App email address ownership (in the permissions section); to use a service account (for 2LO authentication) you then click on 'Create New Client ID' & then generate a new P12 key that you will use in your application, if you also generate the JSON key the text in that key will contain an email address that you will need later.

GOOGLE APPS: https://admin.google.com/[AppDomain]/AdminHome?fral=1 In the admin console go to security & choose 'Manage API Client Access'. The API Client Name should be taken from the JSON file generated from the previous steps; the scope should match the scope you will use in code when you set up the service account credential object. If you look at the Google Code Playground (https://developers.google.com/oauthplayground/) you will see the exact spellings & setup of all possible API scopes. For fusion tables scope is currently https://www.googleapis.com/auth/fusiontables

FUSION TABLE: The fusion table now needs the business admin email account as an editor

Everything should now be setup to access a private fusion table from code. Lots of example code at: https://developers.google.com/oauthplayground/

Upvotes: 3

sanya
sanya

Reputation: 890

First thing to note: If you want to visualize this data on a Google Map on your webpage(using FusionTablesLayer) your only option is to share your table as public. That means read access to everyone. No workarounds. Live with it.

For write access: you can use the Google Drive API to set permissions on your fusion table. https://developers.google.com/drive/v2/reference/permissions/insert You need to create the fusion table first with your admin account (i think a service account is more suitable) and then use permissions to give access to whoever visits your page.

Upvotes: 0

Related Questions