betodealmeida commented on issue #7565:
URL: https://github.com/apache/superset/issues/7565#issuecomment-824350448


   For org-based sheets:
   
   1. Create a service account.
   2. Enable domain-wide delegation on the account.
   3. Download the key as JSON.
   4. Add "client name" to "Manage OAuth clients", with the scope 
“https://spreadsheets.google.com/feeds”.
   5. In the DB configuration add the JSON payload to a key called 
`service_account_info` under `engine_params`.
   6. Alternatively, add a key called `service_account_file` under 
`engine_params` pointing to the location of the JSON file.
   
   An example:
   
   ```json
   {
     "metadata_params": {},
     "engine_params": {
       "subject": "[email protected]",
       "service_account_file": "/path/to/file.json",
       "service_account_info": {
         "type": "service_account",
         "project_id": "gsheetsdb",
         "private_key_id": "XXX",
         "private_key": "-----BEGIN PRIVATE KEY-----\nXXX\n-----END PRIVATE 
KEY-----\n",
         "client_email": "[email protected]",
         "client_id": "109948634192943148536",
         "auth_uri": "https://accounts.google.com/o/oauth2/auth";,
         "token_uri": "https://oauth2.googleapis.com/token";,
         "auth_provider_x509_cert_url": 
"https://www.googleapis.com/oauth2/v1/certs";,
         "client_x509_cert_url": 
"https://www.googleapis.com/robot/v1/metadata/x509/shillelagh%40gsheetsdb.iam.gserviceaccount.com";
       }
     },
     "metadata_cache_timeout": {},
     "schemas_allowed_for_csv_upload": []
   }
   ```
   
   You can also define a `DB_CONNECTION_MUTATOR` to add the credentials and 
`subject` for each request ("subject" should be the org email for the logged 
user).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to