Managing sessions with Angularfire, Passport and Express/Nodejs

Viewed 86

I have a NodeJS/AngularJS application and I want to use angularfire to manage my user's login/registration at the client. E.g.

$firebaseAuth.$signInWithEmailAndPassword(email, password).then(function(auth) {
    // communicate with backend server and redirect to secure site using auth obj
}, function(error) {});

After successfully logging in at the client, I want to post the auth object to the backend server to verify the user with Firebase. Then create a session in my NodeJS/Express application then redirect the user to a secure page. Previously I was using passport to create sessions from an email and password, but I don't know how to adapt passport to use the auth object retrieved by angularfire instead. Although there is a passport module for Firebase there is no working example code. Can anyone provide working code or instructions on how to verify the user with Firebase and establish a secure session in my NodeJS\Express application, preferably using passport?

0 Answers
Related