Rails app with two kinds of login - ruby-on-rails

I have created a rails app with my own login system, and now I would like the user to be able to login with the facebook API (omniauth) aswell.
So how do I implement this, so my users will be able to create or login with my version and be able to login with facebook?
Can they work on the same database or do I need two separate?
Any guides you can recommend?

This is covered in this Railscast: #241 Simple OmniAuth.

Related

Rails integrate own website, Facebook and Twitter account as just one

I am new to Rails. Currently, i am building an app that will be able to login with facebook, twitter and also my own website account. i am thinking to do a user just like the Pinterest, but i don't know how to integrate them as just one account. Any one has any idea about this? Thank you.
OmniAuth may be what you want.
http://railscasts.com/episodes/241-simple-omniauth
you need something like this??
http://openid.net/developers/
but actually, when u trying to access the user's account(such as google,facebook, twitter), you have to get the permission from the users as well, so there will be a need to integrate both of those in once too.

How do I authenticate a user if they are not using my web (rails) application, e.g. using an API

I have created a Rails (3.2) application that uses the OmniAuth gem to provide OAuth authentication. Users can log into the site using their Twitter, Facebook or Google credentials, pretty bog-standard functionality.
I now want to make the data available via an API so it can be consumed outside of my web application, however, users would still have to login to be able to access their data. How do I do this in my Rails APP? And what would the user have to do to be able to call this?
UPDATE
Some people are suggesting "alternative" authentication methods, but I am wondering if I cannot use the same OAuth credentials I already have for them. I don't want them to have to provide another username/pwd, I want them to be able to use their Twitter, Facebook or Google Identities as they do when they use the WebUI.
authenticate_with_http_basic (or digest if you like) might work for you, called from a before filter in the controller.
You can test with curl, using the --user parameter.
Here's a good thread on the topic:
In Ruby on Rails, what does authenticate_with_http_basic do?
Devise has the feature token authentication which is what you are looking for.
Also visit http://zyphmartin.com/blog/simple-auth-token-example-with-devise

Rails user registration using Twitter / Facebook / Google?

Is Devise a good option? Another extension? Roll my own as per OAuth in Rails - google, twitter, facebook, connect for login like stackoverflow login?
You can go with Devise in combination with Omniauth or use Omniauth on its own building your own authentication. You need to decide whether you want local+remote sign-up or remote sign-up only. I did both recently and wrote articles about it:
Devise + Omniauth: http://communityguides.heroku.com/articles/11
Omniauth, includes full code on Github: http://communityguides.heroku.com/articles/16
(Links updated 15.12.2012)
Edit: Regarding local sign-up - you might use myopenid as a replacement and send users over there if they do not have or do not want a Twitter/FB/Google account...
I highly recommend Devise (1.2 or newer) with OmniAuth. I have been successful in using that combination to enable single sign-on from a Rails application to GitHub, and it's fairly trivial to add support for additional providers.
https://github.com/plataformatec/devise/wiki/OmniAuth%3A-Overview

How to integrate Facebook in Rails

I hava a Rails application, I need to integrate Facebook. User can login with Facebook account and get his reviews in facebook and so on, how to deal with this case in rails? thanks!
Facebooker is no longer supported I recommend using Koala gem: https://github.com/arsduo/koala/wiki
There is a very comprehensive article here: http://www.packtpub.com/article/facebook-application-development-ruby-on-rails
And several existing plugins for this purpose like 'rfacebook', 'facebooker' or 'facebook-rails'. 'Facebooker' definitely has Facebook Connect abilities.

Rails 3 multiple accounts authentication solution

I am searching for a working solution of authentication on Rails 3 with the following features:
account types: standard login, facebook connect, openid, oauth
one user may have (and link) multiple accounts (EG a user attach both Wordpress and Google OpenID accounts)
A working example of Rails app implementing them would be perfect.
You could take a look at devise even thought it doesn't have every feature that you're asking for. But then again I doubt there's something out there doing all that.
Sounds like https://www.ruby-toolbox.com/gems/socialite is hoping to be what you're looking for.

Resources