Using passport.js to connect a local strategy to another (Facebook, Twitter, Google, etc)

I have a node.js application which uses passport (with a modified passport-local for the login strategy) for authentication management. I would like to allow users to connect their social network accounts using passport strategies, but from what I can see the existing authentication (on the request object) gets overwritten when a new one is made.

How should I approach this?

I was using passport.authenticate when I should have been using passport.authorize!

docs here: http://passportjs.org/guide/authorize/

I've created a sample for that see https://github.com/fpp/drywall

It allows to associate one or more social accounts with a local strategy user, create local strategy users from social accounts, plus add/remove social accounts from these users.

Currently twitter & github are implemented - just add other passport versions and adjust the code sample for more services.

The sample uses Node.js 0.8x, express 3.x and backbone.js - includes some basic user management from the http://jedireza.github.com/drywall/ sample project.

P.S. I could not get a second route (for the same social service) / authorize vs authenticate with passport working as described in the passport documentation. Use

passReqToCallback: true

in the strategy instead and work on the user (see example for more).