Skip to main content

generateCodeVerifier

Note
Please contact Zalopay Team to be granted permission to use this functionality.

Mô tả

This function generates a high-entropy cryptographic random string used as the code verifier in the PKCE (Proof Key for Code Exchange) flow for OAuth 2.0 authorization.

Parameters

Return Value

ParamData typeDescription
codeVerifierstringA high-entropy cryptographic random string used as the code verifier.

Error Code

Sample Code and Sample Return Data

Sample Request:

window.zlpSdk.User
.generateCodeVerifier()
.then((response) => console.log(response))
.catch((error) => console.error(error.errorCode));

Sample Response:

{
"status": "success",
"data": {
"codeVerifier": "dkulv6iNthq8zWWpXKOsKqTlS0_VsLSfMnY2LCW4.Lz"
}
}