设置多个提供程序设计:omniauthable [英] Setup multiple providers with devise :omniauthable

查看:91
本文介绍了设置多个提供程序设计:omniauthable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚获得Devise 1.2支持与OmniAuth教程集成工作但是我想设置多个提供商来引用同一个用户。我正在寻找一些很好的示例代码来查看。

I just got "Devise 1.2 supports integration with OmniAuth tutorial" working but I'd like to setup multiple providers to refer the same user. I'm looking for some good sample code to look at.

我也不确定多个提供者是否可能使用默认的devise:omniauthable实现和我'喜欢达到一个用户多个提供者的效果,像Ryan Bates 235- omn​​iauth-part-1 236-omniauth-part-2 但是,如果您已经知道了一些例子,我是否会问,如果一个更干净的方式,较少的混合模式,您的意见可能是可能的。

I'm also not sure "multiple providers" is possible with default "devise :omniauthable" implementation and I'd like to reach the "one user many providers" effect, like described by Ryan Bates 235-omniauth-part-1, 236-omniauth-part-2 but I'm asking if a cleaner way, less hacked mixed models, could be possible in your opinion and may be, if you already know some examples.

提前感谢
luca

thanks in advance luca

推荐答案

正在要求代码:我已经写了一篇关于Devise + Omniauth的文章,这篇文章很长,包含了源码和说明。它位于这里: http://www.communityguides.eu/articles/11 。所采取的方法与您提到的Railscasts相当。

As you are asking for code: I have written an article on Devise+Omniauth, that is quite long and consists of source and explainations. It is located here: http://www.communityguides.eu/articles/11. The approach taken is comparable to the Railscasts you mention.

我与Omnitauth的Devise实现功能有多个提供商,Google,Facebook,Twitter和Github。但是,我没有用Devise 1.2测试,我还在运行1.1.7。如果你觉得它很有用,请让我知道,如果它适用于Devise 1.2。

My implementation of Devise with Omnitauth features multiple providers, Google, Facebook, Twitter and Github. However, I did not test this with Devise 1.2, I am still running 1.1.7. If you find it useful please let me know, if it works for Devise 1.2.

更新2011年11月14日:
...另见, Omniauth pure:使用Facebook,Google,Google Apps,Twitter,Github,AOL,MyOpenID ...进行身份验证本文将演示如何仅使用Omniauth设置多提供商身份验证。

UPDATED jun 14 2011: ... see also, Omniauth pure: Authentication with Facebook, Google, Google Apps, Twitter, Github, AOL, MyOpenID, ... This article will demonstrate how to set up a multi-provider authentication using Omniauth only.

这篇关于设置多个提供程序设计:omniauthable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆