Skip to content

Commit 3427678

Browse files
committed
API-2197 update README for client credentials usage
1 parent ae639dd commit 3427678

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,36 @@ bynder_client = BynderClient(
8484
permanent_token=''
8585
)
8686
```
87+
To use client credentials grant type, add the field `client_credentials` to `secret.json` and set the field to true.
88+
89+
```json
90+
{
91+
"domain": "*****",
92+
"client_id": "*****",
93+
"client_secret": "******",
94+
"client_credentials": true,
95+
"scopes": ["asset.usage:write", "collection:write", "meta.workflow:read", "asset:write", "asset:read", "meta.assetbank:write", "collection:read", "admin.user:read", "meta.assetbank:read", "current.user:read", "current.profile:read", "offline", "admin.profile:read", "asset.usage:read", "admin.user:write"]
96+
}
97+
```
98+
``` python
99+
# client credentials grant type
100+
elif self.config_data.get('token', None) is None and self.config_data.get('client_credentials', None) == True:
101+
bynder_client.fetch_token(code=None)
102+
```
103+
104+
```python
105+
bynder_client = BynderClient(
106+
**self.config_data,
107+
token_saver=self.token_saver, # optional, defaults to empty lambda
108+
)
109+
```
110+
Client credentials provided as keyword argument:
111+
```python
112+
bynder_client = BynderClient(
113+
client_credentials=True,
114+
token_saver=self.token_saver, # optional, defaults to empty lambda
115+
)
116+
```
87117

88118
Finally call one of the API's endpoints through one of the clients:
89119

0 commit comments

Comments
 (0)