OAuth implementation for Ruby. Note official maintained version is now at http://github.com/mojodna/oauth
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin We dont need to require rubygems in the bin as rubygems will wrap the… Mar 10, 2010
examples removed unused assignment May 18, 2009
lib Merge branch 'oauth-ruby' Sep 3, 2010
tasks Updated deployment info to be 0.2.6 Sep 9, 2008
test Massive whitespace commit Sep 1, 2010
.gitignore Add Bundler/Gemfile Aug 11, 2010
Gemfile fix support for em-http-request 0.2.11 Sep 1, 2010
Gemfile.lock fix support for em-http-request 0.2.11 Sep 1, 2010
LICENSE Removing a bunch of newgem artifacts Mar 10, 2010
README.rdoc Update README Apr 22, 2010
Rakefile Updated history. ActiveSupport dependency should be more flexible. Sep 3, 2010
TODO TODO Feb 6, 2010
oauth.gemspec Regenerated gemspec for version 0.4.3 Sep 1, 2010


Ruby OAuth


This is a RubyGem for implementing both OAuth clients and servers in Ruby applications.

See the OAuth specs oauth.net/core/1.0/


sudo gem install oauth

The source code is now hosted on the OAuth GitHub Project github.com/oauth/oauth-ruby

The basics

This is a ruby library which is intended to be used in creating Ruby Consumer and Service Provider applications. It is NOT a Rails plugin, but could easily be used for the foundation for such a Rails plugin.

As a matter of fact it has been pulled out from an OAuth Rails Plugin code.google.com/p/oauth-plugin/ which now requires this GEM.

Demonstration of usage

Create a new consumer instance by passing it a configuration hash:

@consumer = OAuth::Consumer.new("key","secret", :site => "https://agree2")

Start the process by requesting a token

@request_token = @consumer.get_request_token
session[:request_token] = @request_token
redirect_to @request_token.authorize_url

When user returns create an access_token

@access_token = @request_token.get_access_token
@photos = @access_token.get('/photos.xml')

Now that you have an access token, you can use Typhoeus to interact with the OAuth provider if you choose.

oauth_params = {:consumer => oauth_consumer, :token => access_token}
hydra = Typhoeus::Hydra.new
req = Typhoeus::Request.new(uri, options) 
oauth_helper = OAuth::Client::Helper.new(req, oauth_params.merge(:request_uri => uri))
req.headers.merge!({"Authorization" => oauth_helper.header}) # Signs the request
@response = req.response

More Information

How to submit patches

The source code is now hosted on the OAuth GitHub Project github.com/oauth/oauth-ruby

To submit a patch, please fork the oauth project and create a patch with tests. Once you're happy with it send a pull request and post a message to the google group.


This code is free to use under the terms of the MIT license.


OAuth Ruby has been created and maintained by a large number of talented individuals. The current maintainer is Aaron Quint (quirkey).

Comments are welcome. Send an email to via the OAuth Ruby mailing list groups.google.com/group/oauth-ruby