File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1152,7 +1152,8 @@ assert api.session == session
11521152## Token and Authorization Requests serialization
11531153
11541154If 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
11581159from requests_oauth2client import BearerToken, TokenSerializer
@@ -1162,9 +1163,9 @@ token_serializer = TokenSerializer()
11621163bearer_token = BearerToken(" access_token" , expires_in = 60 ) # here is a sample token
11631164serialized_value = token_serializer.dumps(bearer_token)
11641165print (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
11701171deserialized_token = token_serializer.loads(serialized_value)
You can’t perform that action at this time.
0 commit comments