Skip to content

pkce

pkce~getHashForCodeChallenge(method, verifier) ⇒ String | undefined

Return hash for code-challenge method-type.

Kind: inner method of pkce

ParamTypeDescription
methodStringthe code challenge method
verifierStringthe code_verifier

pkce~codeChallengeMatchesABNF(codeChallenge) ⇒ Boolean

Matches a code verifier (or code challenge) against the following criteria:

code-verifier = 43*128unreserved unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" ALPHA = %x41-5A / %x61-7A DIGIT = %x30-39

Kind: inner method of pkce
See:: https://datatracker.ietf.org/doc/html/rfc7636#section-4.1

ParamType
codeChallengeString

pkce~isPKCERequest(grantType, codeVerifier) ⇒ boolean

Check if the request is a PCKE request. We assume PKCE if grant type is 'authorization_code' and code verifier is present.

Kind: inner method of pkce

ParamType
grantTypeString
codeVerifierString

pkce~isValidMethod(method) ⇒ boolean

Checks if the code challenge method is one of the supported methods 'sha256' or 'plain'

Kind: inner method of pkce

ParamType
methodString