Authentication In Rest Node Js Server, Using An Android Client With Facebook Login
In my android app I have a facebook login which gives me an access token and profile ID, however I do not understand how to use them to authenticate in my node js REST server. Than
Solution 1:
there are several ways to authenticate :
option 1 :
Send Fb id to node js server where it checks in db that if the user already exists then generate jwt token in return ,else create a new user by its fb id and return a jwt token and save this token on client side to authenticate every request in headers.
option 2 :
this will be a secure one , pass fb id and token both to the node js server, first authenticate the fb-token directly with the facebook API then perform the same functionality as in option 1.
Post a Comment for "Authentication In Rest Node Js Server, Using An Android Client With Facebook Login"