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

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 链接通过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)

还有更多

原文链接:https://www.f2er.com/ruby/268185.html

猜你在找的Ruby相关文章