skip to Main Content

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?

2

Answers


  1. Just add new field and name it as facebook_id(bigint):

    1. on sign in/up flow you will get facebook token from client.
    2. you need to request to facebook api for get user profile from token.
    3. 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.

    Login or Signup to reply.
  2. Check this package:
    https://laravel.com/docs/7.x/socialite

    It provides social authentication out of the box for laravel including facebook login.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search