本文介绍了Ruby on Rails:添加 Facebook 登录、Twitter 登录、OpenID 登录等的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在 Ruby on Rails 应用上运行,Authlogic 负责处理我的身份验证和用户管理.

I'm currently running on a Ruby on Rails app with Authlogic handling my authentication and user management.

我正在努力寻找有关将 3rd 方登录方法添加到我的网站的最佳方式的最新信息,以补充标准的注册和登录.那里有许多教程,但似乎都已过时或不完整.我能否就将多个 3rd 方登录方法添加到 Authlogic 的最佳方式获得一些建议?

I'm struggling to find up to date information on the best way to add 3rd party login methods to my site, supplementing the standard sign up and login. There are a number of tutorials out there, but all seem to be outdated or incomplete. Could I get some recommendations on the best way to add multiple 3rd party login methods to Authlogic?

Authlogic 似乎是为这种类型的事情从头开始构建的,但它的文档很差,它是 自己的页面在这方面似乎非常过时.

Authlogic appears to be built from the ground up for this type of thing, but it's very poorly documented, and it's own page seems very outdated on this.

他们似乎建议 Facebook 使用 authlogic_facebook_connect 插件,而后者又依赖于过时的 Facebooker gem,已被 Facebooker2 取代.有没有办法将 Facebooker2 与 Authlogic 一起使用?

They seem to recommend for Facebook using authlogic_facebook_connect plugin, which in turn relies upon the outdated Facebooker gem, which has been replaced by Facebooker2. Is there a way to use Facebooker2 with Authlogic?

我还在 Google 上找到了 authlogic_oauth2,这是一个更现代的插件,可以使用 Facebook 登录使用 OAuth2 的凭据.不幸的是,作者指出,由于冲突,此插件不能与 OAuth (Twitter) 和 OpenID 的 Authlogic 插件一起使用.

I have also found on Google authlogic_oauth2, which is a more modern plugin that can login using Facebook credentials using OAuth2. Unfortunately, the author states that this plugin cannot be used alongside Authlogic plugins for OAuth (Twitter) and OpenID due to conflicts.

我可以一起使用哪些推荐的 gem 或插件来允许通过 Facebook、Twitter 和 OpenID 登录我的网站?

推荐答案

这看起来很有趣.打算试一试.

This looks interesting. Planning to give it a shot.

https://github.com/plataformatec/devise/wiki/Extensions

我试过了,我正在使用 devise 和 omniauth 来处理这个:

I tried it and I am using devise and omniauth together to handle this:

查看这些链接:

http://railscasts.com/episodes/209-introducing-devise

http://railscasts.com/episodes/210-customizing-devise

http://railscasts.com/episodes/235-omniauth-part-1

http://railscasts.com/episodes/236-omniauth-part-2

这是一个很好的解决方案

It is a very good solution

这篇关于Ruby on Rails:添加 Facebook 登录、Twitter 登录、OpenID 登录等的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 00:23