From 7b973178b9848301d2776b05fa432e20dbd0ec9c Mon Sep 17 00:00:00 2001 From: Rob Marty Date: Mon, 25 Nov 2024 11:46:53 -0500 Subject: [PATCH] bearer instructions --- README.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7ee38c0..e21e05e 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,19 @@ devtools::install_github("worldbank/blackmarbler") ## Bearer Token +To obtain a bearer token, you'll need to have a registered [NASA Earth Data account](https://ladsweb.modaps.eosdis.nasa.gov/). On the webpage, click "login" and create a username/password if needed. + +After an account is created, the NASA Bearer Token can be retrieved either using the `get_nasa_token` function or manually (see below). + +### Programmatically retrieve token + +The NASA Bearer Token can also be programmatically retrieved using the `get_nasa_token()` function. After making an account, the `get_nasa_token()` function uses your username and password to retrieve the Bearer token. + +```r +bearer <- get_nasa_token(username = "USERNAME-HERE", + password = "PASSWORD-HERE") +``` + ### Manually retrieve token The function requires using a **Earthdata Download Bearer Token**; to obtain a token, follow the below steps: @@ -68,14 +81,7 @@ The function requires using a **Earthdata Download Bearer Token**; to obtain a t NASA LAADS Bearer Token

-### Manually retrieve token
-The NASA Bearer Token can also be automatically retrieved using the `get_nasa_token`. After making an account, the `get_nasa_token` uses your username and password to retrieve the Bearer token. - -```r -bearer <- get_nasa_token(username = "USERNAME-HERE", - password = "PASSWORD-HERE") -``` ## Usage