Proof of Key Code Exchange (PKCE)
// Dependency: Node.js crypto module (https://nodejs.org/api/crypto.html#crypto_crypto)
Â
function base64URLEncode(str) {
return str.toString('base64')
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=/g, '');
}
Â
// The client generates a random string of bytes and saved into a persistent session store
let codeVerifier = base64URLEncode(crypto.randomBytes(32));Last updated
Was this helpful?
