Integrate OAuth account with local account

Viewed 14

In my app a have two login types

  1. name/password
  2. facebook

However i am not sure how to integrate the faceboo login. I have table user that holds

  1. name
  2. email
  3. phone number
  4. password

When user logs with facebook, he sends access token. I first validate the access token and then create user in my db if its not already present.

Now i am not sure what is the standard way how to create the account from facebook login. Should i create new user with email of facebook acount and some random generated password assuming the user will log only with the facebook access token? Or should i keep two separated tables? ( but in that cases i have to duplicate all relations with there will be some ).

What is the standard and best way of doing this?

Thanks!

0 Answers
Related