This post is just a simple straightforward description of Omniauth:Overview , intended for the beginners , those who wants to try the OmniAuth for the first time with Facebook , Google & Twitter. This post will cover all the basic information i.e From creating the app in Facebook, Google & Twitter for getting the secret key To connect these Apps to your Rails Application.
Things in common :
add Devise & omniauth gem to your Gemfile.
gem 'omniauth'
gem 'devise'
First of all install Devise into your application.
rails generate devise:installYou have to create user model using devise ,
rails g devise userand after that we need to add 2 more columns i.e "uid" and 'provider' to our user model.
rails g migration AddColumnsToUsers provider:string uid:string rake db:migrate
We have done with the things that is common in authentication using facebook,Google, Twitter.
We will start with Facebook Authentication first
Facebook Authentication :
add gem 'omniauth-facebook' to your gem file.
First of all you need to create an application in facebook to get the secret key out .