Authorization
This authorization system is designed to enable third-party access to secured endpoints by verifying the authenticity of requests using a secret-based authentication process.
const crypto = require("crypto");
function generateNonce() {
return crypto.randomBytes(16).toString("hex");
}const crypto = require("crypto");
function generateToken(secret, nonce) {
const hash = crypto.createHash("sha256");
hash.update(nonce + secret);
const token = hash.digest("base64");
return token;
}
const secret = "your_secret_here";
const token = generateToken(secret, nonce);Last updated