Rails 3 - Use only OpenID authentication - ruby-on-rails

I want to add authentication to my Ruby on Rails 3 app, but I only need users to be able to authenticate using their Google accounts, because I'm making it a hosted app for the Chrome Webstore, so I think OpenID would work well for this. I want to have some custom fields in the user database to store user-specific data. What should I use for this? I want users to be able to sign up only with OpenID.
Thanks.

You should try omniauth gem, it uses not only Google OpenID. Omniauth takes user's data from provider and pass to your application which is you can amplify

I've been using authlogic and authlogic-oid add-on to handle this.

You could try the devise_openid_authenticatable gem. I haven't used it myself but it looks like it would do what you want using the Devise authentication gem, which is what I use on all of my Rails projects.

Related

How to create a user authentication using rails as backend and ember as frontend

I'm working on eCommerce for my internship project. But I don't know how to create the user authentication using rails and ember
First I assume the following things:
You are using ember to develop your frontend and will consume APIs from the backend.
You are using rails to create the necessary API.
If you want to authenticate users before using your API, check out the doorkeeper and devise gem. Devise takes care of things like storing your user details in the database, resetting the password, etc. The Doorkeeper gem is used to provide authentication and authorization to APIs.
Doorkeeper Link: https://github.com/doorkeeper-gem/doorkeeper
Devise Link: https://github.com/heartcombo/devise

Do you need omniauth to work with koala?

I am a rails newbie and I was wondering if you have to have omniauth in order to work with koala. For example, if I followed this sites code, http://udooz.net/blog/2011/02/facebook-app-using-rails-koala/, would I need omniauth already set up to do so?
No. In that particular example, everything there looks like it should work as is (disclaimer: I have not tried the example myself.) In general, Koala doesn't require OmniAuth.
What OmniAuth gives you is a single gem to let you easily authenticate users with your choice of third-party authentication systems. It would be useful if you are considering allowing your users to login with more than just their Facebook credentials, like Twitter or Open ID credentials.
For completeness, here's the source of most of the information of that blog post from the Koala wiki on Github: https://github.com/arsduo/koala/wiki/Koala-on-Rails
You don't need OmniAuth. I've used Koala only.

how do I share authentication on a rails/rack app with a node.js instance?

I have been trying to figure out how to integrate a node.js app into a rails app and having them share sessions. I've so far only been able to dig up sharing sessions between sinatra and ruby on rails via rack middleware. Is it possible to to do this?
I thought of a workaround involving the ror implementing a rest service that "poops" out a guid that node.js can use to create its own session. This solution however requires having model validations ad such stored in two seperate apps.
just wondering if there was a way to integrate them.
and while using a js based webframework like geddy or express is cool, I have alot of existing rails code and 3rd party libraries such as active merchant that I would have to reinvent.
how about using something like memcached to share a validation mechanism, for example set a session in rails and for every message to the nodeJs server a token is given, nodeJs checks on memcached if the token exists and grants or denies based on that. You would of course add the record on memcached from the rails app
Isn't that the same as sharing authentication between two different domains like openid, facebook connect, twitter sign-in.
from rails site do an openid like redirect to node.js with the authentication information encrypted inside the url and vica versa?
I am wondering if it is not possible to use Custom OAuth Provider Strategy from connect-auth and vica versa because connect-auth is "Authentication middleware for connect". I haven't figured the complete details out, but this might be an option?

Need Recommendations for Twitter and Facebook Gems

I'm building an app in Rails 3. I currently have a user model which is authenticated via devise (email + password auth). I want to be able to show connect to facebook, connect to twitter buttons to the users once they are logged in.
After obtaining the keys from Facebook and Twitter, I'd want to store it in the database for future requests.
Which Ruby Gems should I be using for this use case?
Thanks!
Instead of Facebooker, we just implemented a facebook-connect style login and application using mini_fb
Mini_fb uses the new graph API, which is cool, and was easy to implement. We used Rails3 and authlogic, but difference to devise should be negligible.
For twitter, this twitter gem is nice, but this devise-twitter gem looks nice for login.
Okay, still no answers. Please check out the Ruby Toolbox, I'm sure the answer is there. It will tell you what the most common gems are for your problem if you can figure out the categorization system. Also, facebooker is a nice gem but it's a little old.
Facebooker is deprecated in favour of mogli, which uses the Graph API. And for Twitter, I'd recommend John Nunemaker's twitter. Since you are already using Devise, you can use the devise-twitter as mentioned by Jesse Wolgamott.

Ruby on Rails: Best way to add Facebook login, Twitter login, OpenID login, etc

I'm currently running on a Ruby on Rails app with Authlogic handling my authentication and user management.
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 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.
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?
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.
What are the recommended gems or plugins I can use together to allow login to my site via Facebook, Twitter, and OpenID?
This looks interesting. Planning to give it a shot.
https://github.com/plataformatec/devise/wiki/Extensions
Edit:
I tried it and I am using devise and omniauth together to handle this:
Check out these links:
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
Devise now has built-in OAuth that you can use with Facebook, Github, Twitter, etc. The documentation is quite helpful.
I haven't used it yet, but this one looks promising:
http://github.com/viatropos/authlogic-connect
It seems you can handle multiple oauth logins in a single db table, and the example includes keys for facebook, twitter, google etc etc so looks promising on the multiple-applications front
Click on the below link to get the steps for social login.
This is my blog only..
https://rubysolutions.wordpress.com/2014/07/25/facebook-and-google-sign-in-integration-using-devise-and-omniauth-in-rails-4-app-ruby-2/

Resources