Friday, 11 January 2019

Authentication on a nodejs web application that includes socked.io for chatting.

Hello! I'm working on a hobby project as i make my way through learning nodejs, i come from a background in rails which had Device for authentication.I am struggling a bit with nodejs, i looked at all of the options, passportjs and outsourcing options like auth0 and firebase, i had implemented auth0 but then realized their free limits were 7000 users per month, and after that it becomes a paid plan at about $1400/month if i reach 10k users.So i switched auth0 for firebase admin sdk as users will have accounts and data of their own that i need to authenticate them on the server to serve to them, i set the admin sdk well, after they sign up i get their user id from firebase through the admin sdk which i store on my own database along with the rest of all of the details that i ask for (including account type they chose at sign up), i have been following their docs for implementing sign up and sign in& user sessions.Everything is worked well, users sign up and sign in securely, i can identify them and serve them content according to who they are. However, i'm trying to also implement google logins&signups and maybe facebook later on, on the documentation for the admin sdk there's nothing about using providers for user authentication, only sections that mention using providers are on the web section which is for client side applications only.I've tried to implement it, but i a bit confused as to how have users sign up through google, if success, then send this new user id to my nodejs server so i can store it, and also have them login and set the session cookies so the server knows users are logged in, and what user specifically is it logged in?Is there any easier route/alternative to go at implementing something like this?

Submitted January 11, 2019 at 05:06PM by ASadGirlsFriend

No comments:

Post a Comment