Skip to content

Commit 60c2b8b

Browse files
docs: Update authentication docs (box/box-codegen#650) (#455)
1 parent 3590918 commit 60c2b8b

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "b5ed925", "specHash": "3dc3f1e", "version": "1.10.0" }
1+
{ "engineHash": "038fca8", "specHash": "3dc3f1e", "version": "1.10.0" }

docs/authentication.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
44
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
55

6+
- [Authentication](#authentication)
67
- [Authentication methods](#authentication-methods)
78
- [Developer Token](#developer-token)
89
- [JWT Auth](#jwt-auth)
@@ -13,6 +14,8 @@
1314
- [Obtaining User token](#obtaining-user-token)
1415
- [Switching between Service Account and User](#switching-between-service-account-and-user)
1516
- [OAuth 2.0 Auth](#oauth-20-auth)
17+
- [Retrieve current access token](#retrieve-current-access-token)
18+
- [Refresh access token](#refresh-access-token)
1619
- [Revoke token](#revoke-token)
1720
- [Downscope token](#downscope-token)
1821
- [Token storage](#token-storage)
@@ -316,6 +319,28 @@ if __name__ == "__main__":
316319
app.run(port=4999)
317320
```
318321

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+
319344
# Revoke token
320345

321346
Access tokens for a client can be revoked when needed. This call invalidates old token.

0 commit comments

Comments
 (0)