Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Authenticate: Invalid request #366

Open
3 tasks
RCBlackburn opened this issue Jul 5, 2024 · 1 comment
Open
3 tasks

Cannot Authenticate: Invalid request #366

RCBlackburn opened this issue Jul 5, 2024 · 1 comment

Comments

@RCBlackburn
Copy link

  • rgee version:1.1.7
  • R version: 4.4.0
  • Operating System: Linux Rocky 8.9

At submit an issue, please attached the following information of your rgee session:

  • You have the Python API installed (from terminal):
earthengine -h

NameError: name earthengine is not defined

  • You can find the credentials file on your system:
library(rgee)
ee_path <- path.expand("~/.config/earthengine/credentials")
file.exists(ee_path)

FALSE

  • You can run a simple EE command from R:
library(rgee)

# Initialize the Earth Engine module.
ee_Initialize()

image

Attach your Python (reticulate) configuration:

library(reticulate)
py_config()

image

Description

I am having issues with the authentication step. Instead of generating a code, I get the invalid request displayed above.

What I Did

I have ran:

ee_Intialize(quiet = TRUE)
ee_Authenticate(quiet = TRUE)

ee_Intialize(quiet = FALSE)
ee_Authenticate(quiet = FALSE)

ee_Authenticate(auth_mode = "paste")
ee_Authenticate(auth_mode = "notebook")
ee_Authenticate(auth_mode = "gcloud")
ee_Authenticate(auth_mode = "appdefault")

Each time I run into the invalid request in some form or another.

Any tips for getting around the authentication step would be greatly appreciated!

Thanks.

@fpirotti
Copy link

Run this to authenticae
reticulate::py_run_string("import ee; ee.Authenticate()")
Run this to initialize... now GEE wants projects so you have to define a project - make sure you upgrade to latest GEE API (earthengine-api 0.1.416 ) - projects can be a number or ID (e.g. user/XXXX/projectname)
reticulate::py_run_string("import ee; ee.Initialize(project='309736351492')")

hope it helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants