tidyverse / googledrive

Google Drive R API
https://googledrive.tidyverse.org/
Other
322 stars 47 forks source link

Access blocked: This app’s request is invalid #433

Closed czechtech closed 1 year ago

czechtech commented 1 year ago

When I try to get authorization, the google website says: Access blocked: This app’s request is invalid

I am using Google Colab with the R kernel. I used pak to get googledrive 2.1.1.9 and gargle 1.5.0.9.

install.packages("pak")
library("pak")
pak::pak("tidyverse/googledrive")
pak::pakI("r-lib/gargle")

install.packages("httr")
install.packages("R.utils")
library("R.utils")
library("httr")
reassignInPackage("is_interactive", pkgName = "httr", function() return(TRUE))
options(rlang_interactive=TRUE)

library("googledrive")
drive_auth(use_oob = TRUE, cache = FALSE)

I follow the link for authorization, but it says: "Access blocked: This app’s request is invalid" "You can’t sign in because this app sent an invalid request. You can try again later, or contact the developer about this issue."

Error 400: redirect_uri_mismatch
The redirect URI in the request, urn:ietf:wg:oauth:2.0:oob, can only be used by a Client ID for native application. It is not allowed for the WEB client type. You can create a Client ID for native application at https://console.developers.google.com/apis/credentials/oauthclient
jennybc commented 1 year ago

Yeah I've identified and fixed a bug in gargle. I'm doing a bit more testing of the fix and will do a patch release soon. In the meantime, you could install the dev version of gargle or roll back to the previous version. I can't really do another release until 1 week has passed, so I need to wait 'til June 17.

timsch0 commented 1 year ago

Dear @jennybc,

I am facing the same issue in Google Colab with R kernel and get the exact same error as mentioned by @czechtech above. However, even after rolling back to gargle version 1.4.0, the error persists. I have been running into this error for about three days now, which seems to be around the newest googledrive release. I also tried rolling back both the googledrive and gargle versions, which also did not work. Do you have any idea what else to try as changing the gargle version back does not resolve the issue?

Thanks in advance for the help and hope the issue is resolved soon!

jennybc commented 1 year ago

My guess is that you did not complete the "roll back" procedure. The most common way this goes wrong is for people to re-install the package, but then they don't restart R, so they are still using the previous version.

Please show a fresh R session, full R code, including packageVersion("gargle").

jennybc commented 1 year ago

Yeah I just successfully used googledrive on Colab, with gargle v1.5.0.9000 (the dev version from GitHub) and googledrive v2.1.1 (the current CRAN release).

timsch0 commented 1 year ago

Yeah I just successfully used googledrive on Colab, with gargle v1.5.0.9000 (the dev version from GitHub) and googledrive v2.1.1 (the current CRAN release).

This worked for me, thank you for your help!