MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / generateCodeChallenge

Function generateCodeChallenge

internal/auth/codex/pkce.go:53–56  ·  view source on GitHub ↗

generateCodeChallenge creates a code challenge from a given code verifier. The challenge is derived by taking the SHA256 hash of the verifier and then Base64 URL-encoding the result. This is sent in the initial authorization request and later verified against the verifier.

(codeVerifier string)

Source from the content-addressed store, hash-verified

51// Base64 URL-encoding the result. This is sent in the initial authorization
52// request and later verified against the verifier.
53func generateCodeChallenge(codeVerifier string) string {
54 hash := sha256.Sum256([]byte(codeVerifier))
55 return base64.URLEncoding.WithPadding(base64.NoPadding).EncodeToString(hash[:])
56}

Callers 1

GeneratePKCECodesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected