docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a user authentication service that supports legacy Google OAuth 1.0a authentication for an existing application that needs to maintain backwards compatibility.
Your service must:
/**
* Configures and returns a Passport.js instance with Google OAuth 1.0a strategy
*
* @param {Object} config - Configuration object
* @param {string} config.consumerKey - Google OAuth 1.0a consumer key
* @param {string} config.consumerSecret - Google OAuth 1.0a consumer secret
* @param {string} config.callbackURL - OAuth callback URL
* @param {Function} config.verifyCallback - Function to handle verified user (token, tokenSecret, profile, done) => void
* @returns {Object} Configured Passport instance
*/
function setupGoogleAuth(config) {
// IMPLEMENTATION HERE
}
/**
* Extracts user information from the OAuth profile
*
* @param {Object} profile - Google user profile from OAuth
* @returns {Object} User object with id and displayName properties
*/
function extractUserInfo(profile) {
// IMPLEMENTATION HERE
}
module.exports = {
setupGoogleAuth,
extractUserInfo,
};Provides Google OAuth 1.0a authentication strategy for Passport.js
Authentication middleware framework for Node.js