|
3 | 3 | <!-- START doctoc generated TOC please keep comment here to allow auto update --> |
4 | 4 | <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
5 | 5 |
|
| 6 | +- [Authentication](#authentication) |
6 | 7 | - [Authentication methods](#authentication-methods) |
7 | 8 | - [Developer Token](#developer-token) |
8 | 9 | - [JWT Auth](#jwt-auth) |
|
13 | 14 | - [Obtaining User token](#obtaining-user-token) |
14 | 15 | - [Switching between Service Account and User](#switching-between-service-account-and-user) |
15 | 16 | - [OAuth 2.0 Auth](#oauth-20-auth) |
| 17 | +- [Retrieve current access token](#retrieve-current-access-token) |
| 18 | +- [Refresh access token](#refresh-access-token) |
16 | 19 | - [Revoke token](#revoke-token) |
17 | 20 | - [Downscope token](#downscope-token) |
18 | 21 | - [Token storage](#token-storage) |
@@ -316,6 +319,28 @@ if __name__ == "__main__": |
316 | 319 | app.run(port=4999) |
317 | 320 | ``` |
318 | 321 |
|
| 322 | +# Retrieve current access token |
| 323 | + |
| 324 | +After initializing the authentication object, the SDK will able to retrieve the access token. |
| 325 | +To retrieve the current access token you can use the following code: |
| 326 | + |
| 327 | +<!-- sample post_oauth2_token --> |
| 328 | + |
| 329 | +```python |
| 330 | +auth.retrieve_token() |
| 331 | +``` |
| 332 | + |
| 333 | +# Refresh access token |
| 334 | + |
| 335 | +Access tokens are short-lived and need to be refreshed periodically. The SDK will automatically refresh the token when needed. |
| 336 | +If you want to manually refresh the token, you can use the following code: |
| 337 | + |
| 338 | +<!-- sample post_oauth2_token refresh --> |
| 339 | + |
| 340 | +```python |
| 341 | +auth.refresh_token() |
| 342 | +``` |
| 343 | + |
319 | 344 | # Revoke token |
320 | 345 |
|
321 | 346 | Access tokens for a client can be revoked when needed. This call invalidates old token. |
|
0 commit comments