Fix encoding problem when using Py34.
This commit is contained in:
parent
ed26f7bb40
commit
e97c32acd1
1 changed files with 3 additions and 1 deletions
|
@ -99,7 +99,9 @@ class TokenEndpoint(object):
|
||||||
# Validate PKCE parameters.
|
# Validate PKCE parameters.
|
||||||
if self.params.code_verifier:
|
if self.params.code_verifier:
|
||||||
if self.code.code_challenge_method == 'S256':
|
if self.code.code_challenge_method == 'S256':
|
||||||
new_code_challenge = urlsafe_b64encode(hashlib.sha256(self.params.code_verifier.encode('ascii')).digest()).replace('=', '')
|
new_code_challenge = urlsafe_b64encode(
|
||||||
|
hashlib.sha256(self.params.code_verifier.encode('ascii')).digest()
|
||||||
|
).decode('utf-8').replace('=', '')
|
||||||
else:
|
else:
|
||||||
new_code_challenge = self.params.code_verifier
|
new_code_challenge = self.params.code_verifier
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue