Commit c90cf0b6 authored by Vincent Ardisson's avatar Vincent Ardisson Committed by Romain Bignon

python3: OAuth2PKCEMixin codes shouldn't be bytes

parent b3ca3ac4
......@@ -1087,11 +1087,11 @@ class OAuth2PKCEMixin(OAuth2Mixin):
# PKCE (Proof Key for Code Exchange) standard protocol methods:
def code_verifier(self, bytes_number=64):
return base64.urlsafe_b64encode(os.urandom(bytes_number)).rstrip(b'=')
return base64.urlsafe_b64encode(os.urandom(bytes_number)).rstrip(b'=').decode('ascii')
def code_challenge(self, verifier):
digest = sha256(verifier).digest()
return base64.urlsafe_b64encode(digest).rstrip(b'=')
return base64.urlsafe_b64encode(digest).rstrip(b'=').decode('ascii')
def build_authorization_parameters(self):
return {'redirect_uri': self.redirect_uri,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment