0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
`Create new rails app, then run rails g oauth_bundle:install`
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

OauthBundle

OauthBundle bundles devise and Omniauth twitter, facebook, and github strategies. It migrate required columns for your authentication model. Omniauth callbacks controller file is created and defined realted methods. This gem makes your life easier to build the omniauth services with devise gem.

###To-Do List:

Support seperating authentication model from user model.

Installation

Test in OS X system.

Add this line to your application's Gemfile:

gem 'devise'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
gem 'omniauth-github'
gem 'oauth_bundle'

And then execute:

$ bundle

Or install it yourself as:

$ gem install oauth_bundle

Usage

Setup

rails g oauth_bundle:install

Update your app id and app secret for each provider:

# config/initializers/devise.rb
config.omniauth :github, 'APP_ID', 'APP_SECRET'
config.omniauth :facebook, 'APP_ID', 'APP_SECRET'
config.omniauth :twitter, 'APP_ID', 'APP_SECRET'

Handle Callback Data

Each provider correspond to its named method in app/controllers/#{models}/omniauth_callbacks_controller.rb.

Routing Path

  • user_omniauth_authorize_path(:provider_name)
  • user_omniauth_callback_path(:provider_name)

More Information

Contributing

  1. Fork it ( https://github.com/[my-github-username]/oauth_bundle/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Development Digest

  1. Add migration for authentication model.
  2. Add provider, uid columns to authentication model.
  3. Setup before start to use it.
  4. Set tup provider in model.
  5. integrate rails g devise:install and rails g devise user
  6. git add . && git commit --amend --no-edit && rake install
  7. "/app" => absolute path
  8. "app" => relative path, current execution path prefixed.
  9. test your sqlite db: sqlite3 /db/development.sqlite3
  10. http://localhost:3000/rails/info/routes get route info
  11. Twitter dont like developers develop their app under localhost as callback url. 😑
  12. http://www.rubydoc.info/github/erikhuda/thor/master/Thor/Actions#get-instance_method
  13. http://stackoverflow.com/questions/6338908/ruby-difference-between-exec-system-and-x-or-backticks
  14. rake build && gem push <gem>.gem