使用 Devise 的 Rails 3:如何允许某人使用他们的 Facebook 帐户登录? [英] Rails 3 using Devise: How to allow someone to log in using their Facebook account?
问题描述
我有一个使用 Devise 进行身份验证的 Rails 3 应用程序.现在我需要允许某人使用他们的 Facebook 帐户登录.我认为这称为 Facebook Connect,但我也听说过 Facebook Graph API 一词,所以我不确定我要的是哪一个.
I have a Rails 3 application using Devise for authentication. Now I need to allow someone to log in using their Facebook account. I think this is called Facebook Connect, but I've also heard the term Facebook Graph API, so I'm not sure which one I'm asking for.
我需要做什么才能将 Facebook Connect 与 Devise 集成?
What do I need to do in order to integrate Facebook Connect with Devise?
这个问题现在已经很老了.一年前,Devise v1.2 引入了 OmniAuth 支持.现在 Devise 是 v2.1(在撰写本文时)并且使用 OmniAuth 更加容易.这里有一个来自 Devise wiki 的关于 使用 omniauth-facebook的很棒的教程code> gem 与 Devise 允许使用 Facebook 登录
.
This question is pretty old now. A year ago, Devise v1.2 introduced OmniAuth support. Now Devise is at v2.1 (as of this writing) and using OmniAuth is even easier. Here is a great tutorial from the Devise wiki on using the omniauth-facebook
gem with Devise to allow sign-in using Facebook.
另请查看关于注册您的应用程序和使用 Facebook Graph API 的精彩教程.
Also check out this great tutorial on registering your application and working with the Facebook Graph API.
推荐答案
Devise 1.2 现在带有使用 omniauth 的 facebook 登录支持,并与 Rails 3.0 一起使用.查看维基条目.
Devise 1.2 now comes with facebook login support using omniauth and works with Rails 3.0. Check out the wiki entry.
这篇关于使用 Devise 的 Rails 3:如何允许某人使用他们的 Facebook 帐户登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!