加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 链接通过Facebook登录的新用户连接到现有帐户

发布时间:2020-12-17 04:15:18 所属栏目:百科 来源:网络整理
导读:我最近实现了登录我的通过facebook连接.因此,现在用户有2种登录站点的方法.注册帐户的旧方式和新方式(Facebook连接). 我想做的一件事是将新的facebook连接用户帐户链接到现有帐户(如果他们以旧方式登录). 有没有人有这样的成功? 解决方法 我认为非常好的问
我最近实现了登录我的通过facebook连接.因此,现在用户有2种登录站点的方法.注册帐户的旧方式和新方式(Facebook连接).

我想做的一件事是将新的facebook连接用户帐户链接到现有帐户(如果他们以旧方式登录).

有没有人有这样的成功?

解决方法

我认为非常好的问题很多人都会从答案中受益.

您需要记住的是,只要帐户被授权通过Facebook链接,帐户才会被链接.您应该做的是在数据库中维护第二个链接帐户表,以便您知道谁是谁以及他们是否与Facebook链接.

您应该阅读此集成注释,它提供了许多有用的信息.

http://crazyviraj.blogspot.com/2010/01/test-cases-for-basic-facebook-connect.html

它并没有真正说明如何做事,但它确保你勾选你应该做的事情.

即:

Sign Up should fail if the user denies
permission to the app (category: sign
up)

Since we need access to an email
address,Sign Up should fail if the
user provides publish permission but
denies email permission (category:
sign up)

If the user provides an email address
that already exists in your system,
fail Sign Up. Make sure no YouFace
backend tables are modified (category:
sign up,1:1 mapping) PS – when this
happens,I didn’t find a way for you
to de-authorize YouFace on the
Facebook user’s behalf. The user must
manually do this if they wish you use
the same account but provide a
different email address.

Accounts created using Facebook
Connect should not be able to login
using YouFace’s default email/password
login system (category: sign in,
account security). PS: Since YouFace
accounts require a password and those
created using Facebook Connect don’t,
make sure to insert a random password
hash into your table to avoid silly
errors

Accounts created using YouFace should
be able to sign in without requiring
to be signed into Facebook,even if
when a link to a Facebook accounts
exists (category: sign in)

还有更多

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读