Skip to content

Commit fc4814f

Browse files
authored
Clarifying readme for auth keys (#288)
* Clarifying readme * Move to one line
1 parent d8962f4 commit fc4814f

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,28 +132,33 @@ the environment variable ``IMAP_DATA_ACCESS_URL`` or within the
132132
package ``imap_data_access.config["DATA_ACCESS_URL"]``. The default
133133
is the production server ``https://api.imap-mission.com``.
134134

135-
### Automated use with API Keys
135+
### Use with API Keys
136136

137137
The default for the CLI is to use the public endpoints.
138138
To access some unreleased data products and quicklooks, you may
139-
need elevated permissions. To programmatically get that, you need
139+
need elevated permissions. To get that, you need
140140
an API Key, which can be requested from the SDC team.
141141

142-
To use the API Key you can set the `IMAP_API_KEY` environment variable and then use
143-
the tool as usual.
142+
There are two ways to provide your API Key:
143+
144+
1. **Environment variable**: Set the `IMAP_API_KEY` environment variable
144145

145146
```bash
146-
$ IMAP_API_KEY=<your-api-key>
147-
$ imap-data-access ...
147+
IMAP_API_KEY=<your-api-key> imap-data-access ...
148148
```
149149

150-
or with CLI flags
150+
2. **Command line flag**: Use the `--api-key` flag
151151

152152
```bash
153-
$ imap-data-access --api-key <your-api-key> ...
153+
imap-data-access --api-key <your-api-key> ...
154154
```
155155

156-
### Automated use with Access token
156+
The command line flag will override the environment variable if both are set.
157+
158+
> [!NOTE]
159+
> When using an API key, requests are automatically routed to `api.imap-mission.com/api-key` endpoints for authentication.
160+
161+
### Automated use with Access token (for software)
157162

158163
An alternative to using an API key to access protected data is using an access token provided by LASP's authentication server. LASP's authentication uses [keycloak authentication](https://www.keycloak.org/documentation).
159164

0 commit comments

Comments
 (0)