Skip to content

Commit

Permalink
Hotfix 'Attribute error in generate code_challenge ex.' (#1205)
Browse files Browse the repository at this point in the history
* Hotfix 'Attribute error in generate code_challing ex.'

* Added new authors 'Islam Kamel'
  • Loading branch information
islam-kamel committed Sep 22, 2022
1 parent fc0906d commit 9383e08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Authors

Massimiliano Pippi
Federico Frenguelli
Islam Kamel

Contributors
------------
Expand Down
2 changes: 1 addition & 1 deletion docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Now let's generate an authentication code grant with PKCE (Proof Key for Code Ex
code_verifier = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(random.randint(43, 128)))
code_verifier = base64.urlsafe_b64encode(code_verifier.encode('utf-8'))

code_challenge = hashlib.sha256(code_verifier.encode('utf-8')).digest()
code_challenge = hashlib.sha256(code_verifier).digest()
code_challenge = base64.urlsafe_b64encode(code_challenge).decode('utf-8').replace('=', '')

Take note of ``code_challenge`` since we will include it in the code flow URL. It should look something like ``XRi41b-5yHtTojvCpXFpsLUnmGFz6xR15c3vpPANAvM``.
Expand Down

0 comments on commit 9383e08

Please sign in to comment.