Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/generators/omniauth/scaffold
spec
.document
.gitignore
.rspec
Gemfile
README.md
Rakefile
VERSION
omniauth-scaffold.gemspec

README.md

OmniAuth Scaffold

Scaffold for OmniAuth.

Installation

Edit: Gemfile

gem 'omniauth-scaffold'
gem 'omniauth-twitter'
#gem 'omniauth-github'
#gem 'omniauth-facebook'

Execute:

$ bundle

Or install it yourself as:

$ gem install omniauth-scaffold

Usage

Generate omniauth scaffold:

$ rails g omniauth:scaffold

Edit: config/initializers/constants.rb

APP_NAME = "YOUR_APP_NAME"

[ Keys ]
Twitter
GitHub
Facebook

[ Development ]
Edit: config/initializers/local_setting.rb

# Twitter
ENV['TWITTER_KEY'] = "YOUR_CONSUMER_KEY"
ENV['TWITTER_SECRET'] = "YOUR_CONSUMER_SECRET"

# GitHub
#ENV['GITHUB_CLIENT_ID'] = "YOUR_CLIENT_ID"
#ENV['GITHUB_SECRET'] = "YOUR_SECRET"

# Facebook
#ENV['FACEBOOK_APP_ID'] = "YOUR_APP_ID"
#ENV['FACEBOOK_APP_SECRET'] = "YOUR_APP_SECRET"

[ Production ]
Edit: config/initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :twitter, ENV['TWITTER_KEY'], ENV['TWITTER_SECRET']
#  provider :github, ENV['GITHUB_CLIENT_ID'], ENV['GITHUB_SECRET']
#  provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET']
end

[ Heroku ]
Twitter

heroku config:add TWITTER_KEY=YOUR_CONSUMER_KEY
heroku config:add TWITTER_SECRET=YOUR_CONSUMER_SECRET

GitHub

heroku config:add GITHUB_CLIENT_ID=YOUR_CLIENT_ID
heroku config:add GITHUB_SECRET=YOUR_SECRET

Facebook

heroku config:add FACEBOOK_APP_ID=YOUR_APP_ID
heroku config:add FACEBOOK_APP_SECRET=YOUR_APP_SECRET

Migration:

$ rake db:migrate

Start Server:

$ rails s

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Copyright

Copyright (c) 2012 Shun Matsumoto. CC BY-NC-SA 2.1

Something went wrong with that request. Please try again.