简体   繁体   English

iOS SDK使用Facebook用户详细信息进行注册

[英]iOS sdk using facebook user details for registration

Can any of you point me in the right direction of the best practices to use the information obtained from facebook for a forum like application. 你们中的任何人都可以向我指出最佳做法的正确方向,以便将从facebook获得的信息用于类似应用程序的论坛。

So, in the application, the user has the ability to use the facebook login option (also twitter/google options are available). 因此,在应用程序中,用户可以使用facebook登录选项(也可以使用twitter / google选项)。

So, to post a forum like entry, the entry needs to be associated with a user. 因此,要发布类似条目的论坛,条目需要与用户关联。

What is the best way in achieving this? 实现此目标的最佳方法是什么? Using the facebook name/surname + email to create a user on my backend server? 使用Facebook名称/姓氏+电子邮件在我的后端服务器上创建用户?

Any advise would be appreciated please. 任何建议,将不胜感激。

Yes, what you said is correct. 是的,你说的没错。 You can query profile information from the authentication provider. 您可以从身份验证提供程序查询配置文件信息。

I would look at picking up the most common attributes to maintain data consistency across service providers(Facebook, Google, Twitter etc) ie email, firstname, last name. 我将研究如何选择最常见的属性来维护服务提供商(Facebook,Google,Twitter等)之间的数据一致性,例如电子邮件,名字,姓氏。

Create a user in your DB against the email address and authentication provider. 根据电子邮件地址和身份验证提供程序在数据库中创建一个用户。 The data sample would look like below: 数据样本如下所示:

userid   email            authprovider
------   -----            ------------
0001     me@gmail.com     Google
0002     you@gmail.com    Facebook
0003     some@gmail.com   Twitter

userid   ForumEntryId
------   ------------
0001     0001
0001     0002

Every time the user logs in using any of the authentication providers, you could update the profile information like FirstName, LastName. 每次用户使用任何身份验证提供程序登录时,都可以更新配置文件信息,例如FirstName,LastName。

One thing I would like to see someone implement it is that: 我想看到有人实现它的一件事是:

When a user does a login with Facebook and next time around they come in a say login with twitter; 当用户在Facebook上登录时,下次他们会在Twitter中使用说登录名; if the email matches and the provider does not match the site typically says that 'The email is already in use' or something similar. 如果电子邮件匹配且提供商不匹配,则网站通常会说“电子邮件已在使用中”或类似内容。 It would help if the site says 'You logged in with Facebook last time, please use the same account.' 如果该网站显示“您上次使用Facebook登录,请使用相同的帐户”会有所帮助。 or handle it even more gracefully. 或更优雅地处理它。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM