Skip to main content

Function: verifyPkce()

verifyPkce(verifier, challenge, method): boolean

Defined in: auth/src/auth/shared.ts:406

Verifies a PKCE (RFC 7636) code_verifier presented at the token endpoint against the code_challenge recorded at the authorization endpoint. For S256, hashes verifier with SHA-256 and compares the base64url digest to challenge; for plain, compares the values directly.

Parameters​

verifier​

string

The code_verifier presented at /token.

challenge​

string

The code_challenge recorded when the authorization code was issued.

method​

"S256" | "plain"

The code_challenge_method recorded alongside challenge.

Returns​

boolean