Skip to content

Commit f10150d

Browse files
committed
upate auth docs for sdk and cli
1 parent 8a46376 commit f10150d

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

docs/get-started/quick-start-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ And you can see that the value was stored successfully as an environment variabl
8383
echo $PL_API_KEY
8484
```
8585

86-
!!!note "The API Key environment variable is always used first in the Planet SDK"
87-
If you do create a `PL_API_KEY` environment variable, the SDK will use this value. `PL_API_KEY` overrides the value that was retrieved using your Planet login with a call to `planet auth init`. The `planet auth value` call currently does not reflect that `PL_API_KEY` overrides the `auth init` value (this should be fixed in 2.0-beta.1 with [issue 643](https://github.com/planetlabs/planet-client-python/issues/643))
86+
!!!note "The API Key environment variable is ignored by the CLI but used by the Python library"
87+
If you do create a `PL_API_KEY` environment variable, the CLI will be unaffected but the Planet library will use this as the source for authorization instead of the value stored in `planet auth init`.
8888

8989
## Step 5: Search for Planet Imagery
9090

docs/python/sdk-guide.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,18 @@ asyncio.run(main())
4646

4747
## Authenticate with Planet services
4848

49-
There are two steps to managing authentication information, obtaining the
50-
authentication information from Planet and then managing it for local retrieval
51-
for authentication purposes.
49+
A `Session` requires authentication to communicate with Planet services. This
50+
authentication information is retrieved when a `Session` is created. By default,
51+
a `Session` obtains authorization from the following sources with order
52+
indicating priority:
5253

53-
The recommended method for obtaining authentication information is through
54-
logging in, using `Auth.from_login()` (note: using something like the `getpass`
55-
module is recommended to ensure your password remains secure). Alternatively,
56-
the api key can be obtained directly from the Planet account site and then used
57-
in `Auth.from_key()`.
54+
1. The environment variable `PL_API_KEY`
55+
2. The secret file
56+
57+
The SDK provides the `auth.Auth` class for managing authentication information.
58+
This module can be used to obtain authentication information from username
59+
and password with `Auth.from_login()`. Additionally, it can be created with
60+
the API key obtained directly from the Planet account site with `Auth.from_key(<API_KEY>)`.
5861

5962
Once the authentication information is obtained, the most convenient way of
6063
managing it for local use is to write it to a secret file using `Auth.write()`.
@@ -69,16 +72,15 @@ from planet import Auth
6972

7073
pw = getpass.getpass()
7174
auth = Auth.from_login('user', 'pw')
72-
auth.write()
75+
auth.store()
7376

7477
```
7578

76-
When a `Session` is created, by default, authentication is read from the secret
77-
file created with `Auth.write()`. This behavior can be modified by specifying
79+
The default authentication behavior of the `Session` can be modified by specifying
7880
`Auth` explicitly using the methods `Auth.from_file()` and `Auth.from_env()`.
7981
While `Auth.from_key()` and `Auth.from_login` can be used, it is recommended
8082
that those functions be used in authentication initialization and the
81-
authentication information be stored using `Auth.write()`.
83+
authentication information be stored using `Auth.store()`.
8284

8385
The file and environment variable read from can be customized in the
8486
respective functions. For example, authentication can be read from a custom

0 commit comments

Comments
 (0)