We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client.py; get_token(self, code, code_verifier):
return json.loads(token_response.read()) Should be: return json.loads(token_response.read().decode('utf-8'))
It helps as some response value could be byte encoded.
The text was updated successfully, but these errors were encountered:
Thank you! I had to edit also base64_urldecode() to make it work:
base64_urldecode()
diff --git a/client.py b/client.py index ad98c51..db35b1e 100644 --- a/client.py +++ b/client.py @@ -273,7 +273,7 @@ class Client: except URLError as te: print("Could not exchange code for tokens") raise te - return json.loads(token_response.read()) + return json.loads(token_response.read().decode('utf-8')) def get_client_data(self): if not self.client_data: diff --git a/tools.py b/tools.py index 13acd79..3592c22 100644 --- a/tools.py +++ b/tools.py @@ -24,7 +24,7 @@ import ssl def base64_urldecode(s): ascii_string = str(s) ascii_string += '=' * (4 - (len(ascii_string) % 4)) - return base64.urlsafe_b64decode(ascii_string) + return base64.urlsafe_b64decode(ascii_string).decode('utf-8') def base64_urlencode(s):
Sorry, something went wrong.
No branches or pull requests
Client.py; get_token(self, code, code_verifier):
return json.loads(token_response.read())
Should be:
return json.loads(token_response.read().decode('utf-8'))
It helps as some response value could be byte encoded.
The text was updated successfully, but these errors were encountered: