Chuyển đến nội dung chính

generateCodeVerifier

LƯU Ý
Vui lòng liên hệ Đội ngũ Zalopay để được cấp quyền sử dụng tính năng này.

Mô tả​

Hàm này tạo ra một chuỗi ngẫu nhiên mật mã có độ entropy cao, được sử dụng làm mã xác minh trong quy trình PKCE (Proof Key for Code Exchange) của cơ chế ủy quyền OAuth 2.0.

Parameters​

Return Value​

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

Mã lỗi​

Code và Dữ liệu trả về mẫu​

Yêu cầu gửi đi mẫu:

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

Dữ liệu trả về mẫu:

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