14

I am unable to authenticate my googlesheets package. Everytime I run the gs_auth() command I am taken to the chrome where I would usually login to enable the package to access my googlesheets:

enter image description here

However, lately every time I do this I have the following error from Google:

enter image description here

Here my session information:

sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS/LAPACK: /usr/lib/libopenblasp-r0.2.19.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8   
 [6] LC_MESSAGES=C              LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
[1] googlesheets_0.3.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.2        crayon_1.3.4      dplyr_0.8.3       withr_2.1.2       assertthat_0.2.1  cellranger_1.1.0  R6_2.4.0         
 [8] magrittr_1.5      httr_1.4.1        pillar_1.4.2      rlang_0.4.1       cli_1.1.0         curl_4.2          renv_0.8.2-12    
[15] rstudioapi_0.10   tools_3.6.1       glue_1.3.1        purrr_0.3.3       compiler_3.6.1    askpass_1.1       pkgconfig_2.0.3  
[22] sessioninfo_1.1.1 openssl_1.4.1     tidyselect_0.2.5  tibble_2.1.3     

gs_auth()

I have also followed the instructions given here on this stack overflow question. However still no luck.

I have been able to access my sheet using the googledrive package, however I'd still like to fix this.

Thanks!

2 Answers 2

Reset to default

Trending sort

Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.

It falls back to sorting by highest score if no posts are trending.

9

googlesheets4 will replace googlesheets package very soon (by March 2020). Most of the functions performed by googlesheets can be handled by googlesheets4 currently, except for writing to specific cells.

googlesheets4 has a oauth authentication using Gargle (similar to googledrive package). More info can be found here - https://github.com/tidyverse/googlesheets4

4
  • 1
    Does this mean we can't use the original googlesheets package? Nov 18, 2019 at 1:01
  • Googlesheets4 is an absolute mess for Shiny apps. Authentication is a real problem and I haven't been able to solve it yet.
    – Diya
    Aug 20, 2020 at 17:33
  • @Diya if you do find a solution for using googlesheets4 with Shiny, could you please let me know? I've been trying for hours here. It's a real problem Aug 23, 2020 at 0:49
  • @Diya I managed to use it for a bunch of apps deployed on shinyapps.io. What issue are you facing? You can use the token rather than trying to authenticate from the broswer. Sep 7, 2021 at 9:13
2

Adding the answer from Jenny Bryan (maintainer of googlesheets and googlesheets4) from Github to this issue here:

"Default oauth app not working any more" https://github.com/jennybc/googlesheets/issues/397

The link includes pretty detailed, step-by-step instructions, and I won't repeat what's she's already laid out really well. But quick version is you'll need to set up your own API credentials to make the oAuth client work. And remember, that will only help until March 2020.

Probably better, as @Kannan and others point out, is to make the switch to the new googlesheets4 package now if you can.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.