I'm developing an api server in (NodeJs/ hapi) coupled with an android application. I'm having a problem understanding how to do login via a third party like google and facebook.
So far my strategy is:
- authorize my app(android)
- get the email and other data from google/facebook(android)
- Send email and data to my server and save it in a database(server)
Next time when authentication. I'll just check the same data(from google) against the save data(my server). I'm pretty sure there is a better way to do it, but the documentation I have read so far leave me with a head ache.
Help is appreciated.