Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup multiple providers with devise :omniauthable

Tags:

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.

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.

thanks in advance luca

like image 608
Luca G. Soave Avatar asked Mar 24 '11 10:03

Luca G. Soave


1 Answers

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.

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.

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.

like image 84
Markus Proske Avatar answered Nov 17 '22 21:11

Markus Proske