Mints (or reuses) a NASA Earthdata Login (URS) bearer token via the URS user
token API, using your Earthdata username and password. URS allows at most two
active tokens per account. By default an existing token is reused; set
new = TRUE to force a fresh one.
Usage
generate_ed_token(
username = Sys.getenv("EARTHDATA_USERNAME", unset = ""),
password = Sys.getenv("EARTHDATA_PASSWORD", unset = ""),
new = FALSE,
set_renviron = FALSE
)Arguments
- username
NASA Earthdata username. Defaults to the
EARTHDATA_USERNAMEenvironment variable.- password
NASA Earthdata password. Defaults to the
EARTHDATA_PASSWORDenvironment variable.- new
If
FALSE(default), reuse an existing token when the account has one, only minting a new token if none exist. IfTRUE, always mint a fresh token; because URS caps accounts at two, this errors when two already exist (revoke one first).- set_renviron
If
TRUE, append (or update)EARTHDATA_TOKENin~/.Renvironand set it in the current session. Defaults toFALSE, in which case the token is only returned and set for the current session.
