I’m using Facebooks’ API to get user credentials to login/sign-up to my application.
But I’m struggling with what type of credentials should I save to the database as username(email) and password? should I save Facebook’s user-id and token as username and password? or is there another way to do that?
Just add new field and name it as facebook_id(bigint):
- on sign in/up flow you will get facebook token from client.
- you need to request to facebook api for get user profile from token.
- after it success you will get some basic info like (user_id, full_name, email, user_profile, etc). then you can do login.
you can do validate exist email or user_id from facebook depend on your requirement.
hope it can give you some idea and also i’m not a native speaker.
Check this package:
It provides social authentication out of the box for laravel including facebook login.