Prompts the user to authorize access to Earth Engine via OAuth2.

ee_Authenticate(
  user = NULL,
  earthengine = TRUE,
  drive = FALSE,
  gcs = FALSE,
  authorization_code = NULL,
  code_verifier = NULL,
  auth_mode = "notebook",
  scopes = NULL,
  quiet = FALSE,
  verbose = TRUE
)

Arguments

user

Character (optional). If is a character, the credentials are saved in the dirpath: ~/.config/earthengine/$user. If is NULL, the credentials are stored in ~/.config/earthengine.

earthengine

Logical (optional). If TRUE, the EarthEngine credential is cached in the path ~/.config/earthengine/.

drive

Logical (optional). If TRUE, the drive credential is cached in the path ~/.config/earthengine/.

gcs

Logical (optional). If TRUE, the Google Cloud Storage credential is cached in the path ~/.config/earthengine/.

authorization_code

An optional authorization code.

code_verifier

PKCE verifier to prevent auth code stealing.

auth_mode

The authentication mode. One of:

  • 1. paste - send user to accounts.google.com to get a pastable token

  • 2. notebook - send user to notebook authenticator page

  • 3. gcloud - use gcloud to obtain credentials (will set appdefault)

  • 4. appdefault - read from existing $GOOGLE_APPLICATION_CREDENTIALS file

  • 5. None - a default mode is chosen based on your environment.

scopes

List of scopes to use for authentication. Defaults to 'https://www.googleapis.com/auth/earthengine' or 'https://www.googleapis.com/auth/devstorage.full_control'

quiet

If TRUE, do not require interactive prompts and force –no-browser mode for gcloud.

verbose

Logical. Suppress info messages.

Examples

if (FALSE) { # \dontrun{
library(rgee)

# Simple init - Load just the Earth Engine credential
ee_Authenticate()

# At Server side
ee_Authenticate(quiet=TRUE)

} # }