Facebook登录:我的应用程序应该使用哪个参数来识别用户? id或电子邮件?

Facebook登录:我的应用程序应该使用哪个参数来识别用户?  id或电子邮件?

问题描述:

So right now I'm identifying the user via their email [given that they allow it during the Facebook log in process]. But I feel people are able to change their main email address associated with their account, and if they do, it might mess up my app.

So is it better to use their Facebook id instead of email? I believe id is permanent and unique to an individual's Facebook account, correct?

$user['email'] or $user['id']?

所以现在我通过他们的电子邮件识别用户[假设他们在Facebook登录过程中允许它 ]。 但是我觉得人们可以更改与他们的帐户相关联的主要电子邮件地址,如果他们这样做,可能会搞砸我的应用程序。 p>

因此使用他们的Facebook id code>而不是 email code>? 我相信 id code>对于个人的Facebook帐户来说是永久性和独特的,对吗? p>

$ user ['email'] code>或 $ user ['id'] code>? p> div>

Yes, the correct way to identify users (And use as Primary Key in your databases) is with the Facebook Id.

Email people can change and there is people that don't have an email on Facebook.

Another advantage of using the ID, is that you don't need the users to give you access to their email (it's a different permission). Some people might not want to do that!