Passport gives you two hooks where you get to tell it how to serialise/deserialize a user. Basically, you will do something like this :
passport.serializeUser(function(user, callback) {
callback(null, user.id); //You will store the id in session
});
passport.deserializeUser(function(id, callback) {
var query = 'SELECT * FROM user_profiles WHERE id=?';
client.execute(query, function(err, result) {
callback(null,result.rows[0]); //Now we populate whole user using the id
});
});
P.S. The above code is untested and may not work. But it gives the basic idea about Passport integration.
You can use Cassandra Node.js Driver for your DB operations. Passport makes no assumption about how and where you store the data. You can use all sorts of DBs here - MongoDB, Cassandra or MySQL.. The key is using serializeUser and deserializeUser and loading the user object from underlying data store.
Let me know if you have any questions!