0

I have a website where I need to have data that is ID'd by user. For example, they enter their favorite food:

userid       favorite food
------       -------------
1            french fries
2            tacos
3            fish sticks
4            chipotle

When I use Facebook Authentication, what identifier will I use for the userid? I'm assuming it's not name, since this would create duplicates. Is it just the person's Facebook ID?

Also is the correct API to use for 3rd party websites 'Facebook Connect' or 'Facebook Authorization' or something else?

Don P
  • 60,113
  • 114
  • 300
  • 432

3 Answers3

3

When I use Facebook Authentication, what identifier will I use for the userid? I'm assuming it's not name, since this would create duplicates. Is it just the person's Facebook ID?

Yes, use the person's Facebook ID. Other items like their e-mail or name can change, but ID will always be the same for a particular account and can be used to look them up via the various APIs.

Also is the correct API to use for 3rd party websites 'Facebook Connect' or 'Facebook Authorization' or something else?

Facebook has changed the name for this a half dozen times. Currently it's just called "Facebook Login" It does (and always has) used OAuth on the backend. https://developers.facebook.com/docs/concepts/login/

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
1

I think you can use this https://developers.facebook.com/docs/concepts/login/.

When user approves you will be able to get his/her unique facebook user id. That is the ID you can save in your userid column or make a new column for them if you want to separate facebook users with user that registered directly.

Hope it helps.

Marko Francekovic
  • 1,450
  • 10
  • 10
0

You can have any of these as keys.

1.ID (User ID,UID)

2.Email

3.Username (http://facebook.com/username - the username part from there)

4.Profile link (http://facebook.com/username)

Its better to go with id as you may need it later to fetch extra datas from your users.

And Yes, Facebook Connect is the thing, but now called Facebook Login

Kishor
  • 1,513
  • 2
  • 15
  • 25