Skip to content

Commit 55587a4

Browse files
committed
update README
2 parents 0b09d12 + 975028e commit 55587a4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,8 @@ assert api.session == session
11521152
## Token and Authorization Requests serialization
11531153

11541154
If you implement a web application, you will most likely need to serialize access tokens inside the user session.
1155-
To make it easier, `requests_oauth2client` provides several classes that implement (de)serialization.
1155+
To make it easier, `requests_oauth2client` provides several classes that implement (de)serialization of `BearerToken`,
1156+
'DPoPToken', `AuthorizationRequest` (and derivates) and `DPoPKey` to `bytes`.
11561157

11571158
```python
11581159
from requests_oauth2client import BearerToken, TokenSerializer
@@ -1162,9 +1163,9 @@ token_serializer = TokenSerializer()
11621163
bearer_token = BearerToken("access_token", expires_in=60) # here is a sample token
11631164
serialized_value = token_serializer.dumps(bearer_token)
11641165
print(serialized_value)
1165-
# q1ZKTE5OLS6OL8nPTs1TskLl6iilVhRkFqUWxyeWKFkZmpsZWFiYmJqZ6iiB5eNLKgtSlayUnFITi1KLlGoB
1166-
# you can store that string value in session or anywhere needed
1167-
# beware, this is clear-text!
1166+
# b'q1ZKTE5OLS6OL8nPTs1TskLl6iilVhRkFqUWxyeWKFkZmpsZWFiYmJqZ6iiB5eNLKgtSlayUnFITi1KLlGoB'
1167+
# you can store that value in session or anywhere needed
1168+
# beware, this is decodable clear-text!
11681169

11691170
# loading back the token to a BearerToken instance
11701171
deserialized_token = token_serializer.loads(serialized_value)

0 commit comments

Comments
 (0)