views:

1231

answers:

4

Can you suggest some working example of it? I tried Authlogic and Devise withous success.

+1  A: 

Devise is built on Warden, which is the correct google term. Search 'warden openid', 'warden oauth' (twitter) and http://github.com/britt/facebook-warden-strategy for facebook

Tass
+2  A: 

I recently got this working on Rails 3 (with some problems using OpenID). I don't have a complete working example that you can look at on github, but here is what I am using... all of which have examples in the readme files.

Facebook - fbgraph. Unlike Facebooker, it uses the most recent Facebook API. And the source is very easy to understand if you feel like taking a look at the inner workings. Look at the authentication example in the readme. Dead simple.

Twitter - twitter_oauth Again, check out the readme authentication example. This was fairly easy to set up too.

OpenID - rails/open_id_authentication uses ruby-openid gem, but this repo itself is not a gem, so you will have to drop the code into your app or put in your plugin directory. Take a look at their example in the readme and also inspect the source closely to understand what is going on (its only 130 lines of code). I modified a good bit of it to get it to work with my authentication plugin, but I ran into some problems making it work with both Simple Registration and Attribute Exchange at the same time... but you might be able to get it to work out of the box if the rdoc example is suitable for your app.

Let me know if you have any specific questions on these. I ran into a few problems I was able to resolve with all 3 when I was setting this up.

cowboycoded
Thank you for the answer. Are you using any general authentication plugin (like authlogic, devise, restful_authentication) with them, or have you build your own 'standard authentication' solution?
Vlad Zloteanu
I just made my own simple auth plugin. I don't really need all the features that devise and authlogic offer. I looked at the source for both and picked out some things I liked to use in my own role and auth solution. While I don't like reinventing the wheel, I always seem to learn more when I code it myself (while drawing inspiration from other solutions). Plus if I need to extend it, I don't have to dig thru other people's source fr a week to figure it out. I am working on turning the FB/Twitter/OpenID stuff into a rails engine. I will post it here if I get to it in the next few days.
cowboycoded
That would be excellent, thank you :)
Vlad Zloteanu
A: 

AuthLogic has an OpenID extension.

Also, this may help: http://www.michaelhamrah.com/blog/2009/05/authlogic-and-openid-on-rails/

Parker
+2  A: 

I spent about a week trying (unsuccessfully) to get open_id_authentication working. I was trying to use Authlogic and all the associated gems and plugins. I could not get things working the way I wanted. (Authentication would only work with the :action(/:id) route enabled, but when that was enabled, my other controllers wouldn't work because something in the plugin was stripping the params hash - very frustrating).

However, I was finally able to get OpenID working using Devise (http://github.com/plataformatec/devise) and devise_openid_authenticatable (http://github.com/nbudin/devise_openid_authenticatable). I was able to follow the readme's on both of the pages to get everything working exactly like I wanted it to. Simple. Straight forward. And Rails 3.0 compatible.

salt.racer