依靠Facebook的用户ID作为永久性用户标识符 [英] Rely on Facebook user id as a permanent user identifier

查看:1968
本文介绍了依靠Facebook的用户ID作为永久性用户标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在建立一个Web应用程序而现在我们是在决定如何跟踪我们的用户的阶段。我们的默认选项是保持我们自己的用户注册系统这是很多头痛(用户名的唯一性,登记程序等)的。

We are building a web application and right now we are in the stage of deciding how to keep track of our users. Our default option is to maintain our own user registration system which is a lot of headache (user name uniqueness, registration process, etc...).

我们可以利用人们的Facebook身份,这意味着他们将登录到使用他们的Facebook的电子邮件和密码,我们的系统的替代品。那么,我们的后端会获取用户的Facebook ID(图ID),并将其存储在数据库中。用户将改变/上传到应用程序的任何数据都将被链接到这个ID。

As an alternative we can use people's Facebook identity, meaning they will log in to our system using their Facebook's email and password. Then our back-end will fetch the user's Facebook id (Graph id), and store it in the DB. Any data that the user will change/upload to the application will be linked to this id.

现在的问题是,我们可以信任的ID作为永久的标识符,并围绕它建立一个复杂的后端。我们怎样才能确保Facebook不会改变一个人的ID?

The question is, can we trust the id as a permanent identifier, and build a complex back-end around it. How can we be sure that Facebook won't change someone's id ?

等是否身份管理系统,如Azure的访问控制依赖于这个ID?

Does other identity management systems like Azure Access Control rely on this id?

推荐答案

Facebook的平台策略鼓励使用用户id用于除内部使用的任何东西。所以,如果你正计划有其URL是像/用户/,它可能会侵犯Facebook的隐私期望的个人资料页面。你最好做一个用户表代理主键,包括他们的Facebook ID作为非主柱。

Facebook's platform policy discourages using user ids for anything except internal use. So, if you were planning to have a profile page whose url was something like /users/, it would probably violate facebook's privacy expectations. You're better off making a Users table with a surrogate primary key, and including their facebook id as a non-primary column.

此外,您可能会遇到其中一个用户将无法访问他们的旧Facebook帐户,并希望他们的帐户在您的网站有新的Facebook身份相关联的实例。如果你使用他们的Facebook ID在几个表的外键,你已经不必要的纠结他们的旧Facebook的帐号与您的应用程序的数据。

Additionally, you might run into an instance where a user loses access to their old facebook account and wants to associate their account on your site with a new facebook identity. If you use their facebook id as a foreign key in several tables, you have unnecessarily tangled their old facebook id with your application's data.

这篇关于依靠Facebook的用户ID作为永久性用户标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆