javascriptnode.jsoauth-2.0passport.jssocial-authentication

How to add multiple social logins to my webapp and do authentication on client side?


I want to add popular social authentication mechanisms to my website, I looked at the passport library (https://www.npmjs.com/package/passport) but i want to achieve the client side authentication with a popup rather redirecting to the google/ facebook. I see discuss does the similar thing on their iframe embedding. is there any library available in market to do this or i need to do this manually myself?


Solution

  • For authentication via client-side without much effort you may use Firebase(Google's BaaS), it allows you to handle social authentication(Facebook, Google, Twitter, Github, etc...), you can handle user sessions, check if the user is currently logged or not, log the user out, and get social user data, such as profile picture, email, and other types of information based on the permissions that you asked for.

    You might want to take a look at the docs: https://firebase.google.com/docs/

    Or check their own series of video tutorials: https://www.youtube.com/watch?v=-OKrloDzGpU (this tutorial is about Auth on the web)