@@ -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,12 @@ Configuration:
5427
5528Profile Usage:
5629``` python linenums="1"
57- from planet_auth import Auth
58-
59- auth_ctx = Auth.initialize_from_profile(profile = " _profile_name_" )
30+ {% include ' snippets/auth-client-context-from-saved-profile.py' % }
6031```
6132
6233Direct Usage:
6334``` 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- )
35+ {% include ' snippets/auth-client-context-oauth-direct.py' % }
6936```
7037
7138#### Auth Code with PKCE and Client Public Key
@@ -164,6 +131,25 @@ outbound calls, which is one of the primary aims of most auth client types.
164131Instead, this client configuration can only be used to validate incoming
165132tokens.
166133
134+ ### Planet Legacy Client
135+ Implemented by [ planet_auth.PlanetLegacyAuthClient] [ ] and [ planet_auth.PlanetLegacyAuthClientConfig] [ ]
136+
137+ Configuration:
138+ ``` json linenums="1" title="~/.planet/_profile_name_/auth_client.json"
139+ {% include 'auth-client-config/planet-legacy.json' % }
140+ ```
141+
142+ Profile Usage:
143+ ``` python linenums="1"
144+ {% include ' snippets/auth-client-context-from-saved-profile.py' % }
145+ ```
146+
147+
148+ Direct Usage:
149+ ``` python linenums="1"
150+ {% include ' snippets/auth-client-context-pl-legacy-direct.py' % }
151+ ```
152+
167153## Environment Variables
168154See [ planet_auth_utils.EnvironmentVariables] [ ] for a list of environment variables.
169155
0 commit comments