Hi all, I'm using the
googledrive package by way of the
googlesheets4 package, and I'd like to grant non-interactive access to a Google Sheet (e.g. so a cron job can make updates to a sheet on my behalf).
The steps I've taken, I think should work, but clearly I'm missing something here :-/
In my GCS account, I created a Service Account. This returned a JSON token file, which I stored.
In my Google Sheet, I granted edit permissions to the email address associated with the Service Account (which is one of the fields in the token JSON file).
Now my R program looks like so:
library(googledrive) library(googlesheets5) drive_auth(path = "/path/to/my/service/account/token/file.json") sheets_sheet_add("id-of-my-sheet", "new worksheet name")
That last call starts the OAuth2.0 dance, which is exactly what I'm trying to avoid by using the service account's token.
Any ideas for how to allow a background R process to access my Google Sheet without the OAuth2.0 dance?