Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Sample Rails 3 application using Omniauth and Httparty to connect to the platform via the REST APIs
branch: master
Failed to load latest commit information.
app initial commit
config added require header for ruby 1.9.2 compatibility
db initial commit
doc initial commit
lib initial commit
public initial commit
script initial commit
test initial commit
vendor/plugins initial commit
Gemfile initial commit
Gemfile.lock regen with newer rack
README pointed to wiki article
Rakefile initial commit initial commit


Rails 3 with Omniauth, REST and HTTParty example for
This sample rails3 app uses a custom strategy for Omniauth
to connect to using OAuth2, then performs a simple REST
call using Httparty to retrieve a list of Accounts.

How to use it:

files  of note:

lib/forcedotcom.rb - the custom Omniauth strategy
config/initializers/omniauth.rb - add your consumer key and consumer secret here
lib/accounts.rb - the Httparty class which performs a rest call
app/controllers/session_controller.rb - the create method handles the oauth callback
config/routes.rb - includes callback routing
config/environment.rb - includes env variable to set REST API version number
rails/server - I have updated this to support HTTPS. You will need to generate your own
keys and drop them in the lib/certs dir. Check out the README in that dir for more info

Something went wrong with that request. Please try again.