docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build an authentication system that supports multiple Google OAuth authentication strategies for different user types. The system should allow legacy users to authenticate using one OAuth flow while new users can use a different OAuth flow.
Your implementation should:
/**
* Configures and registers multiple Google OAuth strategies with Passport
* @param {Object} passport - Passport instance
* @param {Object} legacyConfig - Configuration for OAuth 1.0a strategy
* @param {string} legacyConfig.consumerKey - Google consumer key
* @param {string} legacyConfig.consumerSecret - Google consumer secret
* @param {string} legacyConfig.callbackURL - Callback URL for legacy authentication
* @param {Object} modernConfig - Configuration for OAuth 2.0 strategy
* @param {string} modernConfig.clientID - Google client ID
* @param {string} modernConfig.clientSecret - Google client secret
* @param {string} modernConfig.callbackURL - Callback URL for modern authentication
*/
function setupMultiStrategyAuth(passport, legacyConfig, modernConfig) {
// Implementation here
}
module.exports = { setupMultiStrategyAuth };Provides Google OAuth authentication strategies for both OAuth 1.0a and OAuth 2.0.