tidyverse / googlesheets4

Google Spreadsheets R API (reboot of the googlesheets package)
https://googlesheets4.tidyverse.org
Other
360 stars 53 forks source link

Impact of OAuth out-of-band deprecation #266

Closed caspercrause closed 1 year ago

caspercrause commented 2 years ago

Google announced that OAuth out-of-band will be deprecated on October 3, 2022 here

I use code that connects to google sheets in a non interactive way by using a service account created on the Google Cloud Platform.

# Authentication:
googlesheets4::gs4_auth(email = 'casper@mypersonalemail.com', path = 'credentials.json')

My_DF <- googlesheets4::read_sheet(master_url, sheet = TabName) 

Connecting this way means that you are not redirected like the image attached: image

Does this mean all non-compliant requests like using a service account will be blocked?

jennybc commented 2 years ago

FYI the issue for tracking the shutdown of OOB auth is here: https://github.com/r-lib/gargle/issues/202. OOB auth should continue to work for the built-in tidyverse client until January 31, 2023, assuming Google continues to honour the extension we were granted.

That being said, I'm confused by what you have above. This code:

googlesheets4::gs4_auth(email = 'casper@mypersonalemail.com', path = 'credentials.json')

is a mash-up of requesting two different forms of auth.

email = 'casper@mypersonalemail.com' is related to an interactive user web flow

path = 'credentials.json' is related to a potentially non interactive service account flow

After successful auth, you should look at gs4_user() to see who you are actually auth'd as: casper@mypersonalemail.com (a normal user) or something more like googlesheets4-dev-testing@robust-fin-276504.iam.gserviceaccount.com (a service account)?

Once you reconcile your intent and what's actually happening, I recommend you simplify the code to provide email or path, but not both.

Once OOB auth is shutdown:

jennybc commented 1 year ago

This matter is settled now with the changes in gargle 1.3.0.