Skip to content

Commit

Permalink
bearer instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ramarty committed Nov 25, 2024
1 parent 75613ac commit 7b97317
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ devtools::install_github("worldbank/blackmarbler")

## Bearer Token <a name="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 <a name="token-automatic">

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 <a name="token-manual">

The function requires using a **Earthdata Download Bearer Token**; to obtain a token, follow the below steps:
Expand All @@ -68,14 +81,7 @@ The function requires using a **Earthdata Download Bearer Token**; to obtain a t
<img src="man/figures/nasa_login_3.png" alt="NASA LAADS Bearer Token" width="500"/>
</p>

### Manually retrieve token <a name="token-automatic">

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 <a name="usage">

Expand Down

0 comments on commit 7b97317

Please sign in to comment.