@@ -9,40 +9,13 @@ AuthClient Configuration dictionaries may either be provided directly, or loaded
99from disk when saved in a ` Profile ` (See below).
1010
1111While it is possible to work directly with the lower level implementation
12- classes, it is generally simpler to use the higher level management code in
13- [ planet_auth.Auth] [ ] , or the factory methods in [ planet_auth.AuthClient] [ ]
14- and [ planet_auth.AuthClientConfig] [ ] to configure and instantiate instances.
15- Directly using the lower level implementations should not be necessary in
16- most cases.
12+ classes, it is generally simpler to organize the working set of objects
13+ with an [ Auth Context] [ planet_auth.Auth ] instance created from one of the
14+ factory methods in [ planet_auth_utils.PlanetAuthFactory] [ ]
1715
1816A number of auth client implementations are provided. Clients should
1917select the one most appropriate for their use case.
2018
21- ### Planet Legacy Client
22- Implemented by [ planet_auth.PlanetLegacyAuthClient] [ ] and [ planet_auth.PlanetLegacyAuthClientConfig] [ ]
23-
24- Configuration:
25- ``` json linenums="1" title="~/.planet/_profile_name_/auth_client.json"
26- {% include 'auth-client-config/planet-legacy.json' % }
27- ```
28-
29- Profile Usage:
30- ``` python linenums="1"
31- from planet_auth import Auth
32-
33- auth_ctx = Auth.initialize_from_profile(profile = " _profile_name_" )
34- ```
35-
36-
37- Direct Usage:
38- ``` python linenums="1"
39- from planet_auth import Auth
40- auth_ctx = Auth.initialize_from_config_dict(
41- client_config = { ... content of auth_client.json ... },
42- token_file = " /my_token_file.json"
43- )
44- ```
45-
4619### OAuth Clients
4720#### Auth Code with PKCE
4821Implemented by [ planet_auth.AuthCodeAuthClient] [ ] and [ planet_auth.AuthCodeClientConfig] [ ]
@@ -54,18 +27,16 @@ Configuration:
5427
5528Profile Usage:
5629``` python linenums="1"
30+ {% include ' snippets/auth-client-context-from-saved-profile.py' % }
31+
5732from planet_auth import Auth
5833
5934auth_ctx = Auth.initialize_from_profile(profile = " _profile_name_" )
6035```
6136
6237Direct Usage:
6338``` python linenums="1"
64- from planet_auth import Auth
65- auth_ctx = Auth.initialize_from_config_dict(
66- client_config = { ... content of auth_client.json ... },
67- token_file = " /my_token_file.json"
68- )
39+ {% include ' snippets/auth-client-context-oauth-direct.py' % }
6940```
7041
7142#### Auth Code with PKCE and Client Public Key
@@ -164,6 +135,25 @@ outbound calls, which is one of the primary aims of most auth client types.
164135Instead, this client configuration can only be used to validate incoming
165136tokens.
166137
138+ ### Planet Legacy Client
139+ Implemented by [ planet_auth.PlanetLegacyAuthClient] [ ] and [ planet_auth.PlanetLegacyAuthClientConfig] [ ]
140+
141+ Configuration:
142+ ``` json linenums="1" title="~/.planet/_profile_name_/auth_client.json"
143+ {% include 'auth-client-config/planet-legacy.json' % }
144+ ```
145+
146+ Profile Usage:
147+ ``` python linenums="1"
148+ {% include ' snippets/auth-client-context-from-saved-profile.py' % }
149+ ```
150+
151+
152+ Direct Usage:
153+ ``` python linenums="1"
154+ {% include ' snippets/auth-client-context-pl-legacy-direct.py' % }
155+ ```
156+
167157## Environment Variables
168158See [ planet_auth_utils.EnvironmentVariables] [ ] for a list of environment variables.
169159
0 commit comments