gd_authenticate {rgeedim} | R Documentation |
Authenticate with Google Earth Engine using gcloud
, "Notebook Authenticator" or other method
Description
Calls ee.Authenticate(...)
to create a local instance of persistent credentials for Google Earth Engine. These credentials are used on subsequent calls to ee.Initialize(...)
via gd_initialize()
.
Usage
gd_authenticate(
authorization_code = NULL,
quiet = FALSE,
code_verifier = NULL,
auth_mode = NULL,
scopes = NULL,
force = TRUE
)
Arguments
authorization_code |
Default: |
quiet |
Suppress warnings, errors, messages? Default: |
code_verifier |
Code verifier (required if |
auth_mode |
One of |
scopes |
List of scopes to use for authentication. Defaults |
force |
Force authentication even if valid credentials exist? Default: |
Details
This method should be called once to set up a machine/project with a particular authentication method.
-
auth_mode="gcloud"
(default) fetches credentials usinggcloud
. Requires installation of command-line Google Cloud tools; see https://cloud.google.com/cli for details. This mode will open a web page where you can sign into your Google Account, then a local JSON file will be stored ingcloud
configuration folder with your credentials. These credentials will be used by any library that requests Application Default Credentials (ADC) which are preferred for long-term storage. -
auth_mode="notebook"
argument is intended primarily for interactive or other short-term use. This mode will open a web page where you can sign into your Google Account to generate a short-term, revocable token to paste into the console prompt. -
auth_mode="appdefault"
mode uses locally stored credentialsgcloud
configuration stored in 'application_default_credentials.json' or JSON file specified byGOOGLE_APPLICATION_CREDENTIALS
environment variable.
Value
This function is primarily used for the side-effect of authentication with the 'Google Earth Engine' servers. Invisibly returns try-error
on error.
Examples
## Not run:
# opens web page to complete authentication/provide authorization code
gd_authenticate(auth_mode = "notebook")
## End(Not run)