gd_authenticate | R Documentation |
gcloud
, "Notebook Authenticator" or other methodCalls 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()
.
gd_authenticate(
authorization_code = NULL,
quiet = FALSE,
code_verifier = NULL,
auth_mode = NULL,
scopes = NULL,
force = TRUE
)
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: |
This method should be called once to set up a machine/project with a particular authentication method.
auth_mode="gcloud"
(default) fetches credentials using gcloud
. 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 in gcloud
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 credentials gcloud
configuration stored in 'application_default_credentials.json' or JSON file specified by GOOGLE_APPLICATION_CREDENTIALS
environment variable.
This function is primarily used for the side-effect of authentication with the 'Google Earth Engine' servers. Invisibly returns try-error
on error.
## Not run:
# opens web page to complete authentication/provide authorization code
gd_authenticate(auth_mode = "notebook")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.