MCPcopy
hub / github.com/authlib/authlib / create_s256_code_challenge

Function create_s256_code_challenge

authlib/oauth2/rfc7636/challenge.py:16–19  ·  view source on GitHub ↗

Create S256 code_challenge with the given code_verifier.

(code_verifier)

Source from the content-addressed store, hash-verified

14
15
16def create_s256_code_challenge(code_verifier):
17 """Create S256 code_challenge with the given code_verifier."""
18 data = hashlib.sha256(to_bytes(code_verifier, "ascii")).digest()
19 return to_unicode(urlsafe_b64encode(data))
20
21
22def compare_plain_code_challenge(code_verifier, code_challenge):

Calls 3

to_bytesFunction · 0.90
to_unicodeFunction · 0.90
urlsafe_b64encodeFunction · 0.90

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…