docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a credential verification utility for OAuth 1.0 development environments. The utility should help developers validate their OAuth credentials by generating signatures using the PLAINTEXT method, which is suitable for local development over HTTPS.
Create a module that verifies OAuth credentials by:
/**
* Generates a PLAINTEXT OAuth signature for the given credentials
* @param {string} consumerSecret - The OAuth consumer secret
* @param {string} tokenSecret - The OAuth token secret (use empty string if not available)
* @returns {string} The PLAINTEXT signature
*/
function generateSignature(consumerSecret, tokenSecret) {
// IMPLEMENTATION HERE
}
/**
* Verifies if the provided signature matches the expected signature for given credentials
* @param {string} providedSignature - The signature to verify
* @param {string} consumerSecret - The OAuth consumer secret
* @param {string} tokenSecret - The OAuth token secret
* @returns {boolean} True if signatures match, false otherwise
*/
function verifyCredentials(providedSignature, consumerSecret, tokenSecret) {
// IMPLEMENTATION HERE
}
module.exports = {
generateSignature,
verifyCredentials
};Provides OAuth 1.0 signature generation capabilities including PLAINTEXT method.