Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
An experiment in creating an OAuth provider with Sinatra
branch: master
Failed to load latest commit information.
lib Make the Oauth Provider a Sintra Rack Middleware app.
views_client Updated css styles.
LICENCE No email - be gone spammers. Updated readme.
consumer.rb Added error handler.
provider.rb Moved OAuth functionality to the Sinatra OAuth Rack Middleware lib.

Sinatra Rack Middleware OAuth Provider

An experiment in creating a Sinatra OAuth Provider as Rack Middleware, a simple OAuth Consumer and API wrapper to tie it all together.

The Rack Middleware takes a simple hash of OAuth protected paths (represented by regular expressions) and associated request methods.

To run the provider:

ruby provider.rb

Go to http://localhost:4567/

To run the consumer:

ruby consumer.rb -p 5678

Go to http://localhost:5678/

Requirements and Installation


sudo gem install sinatra


sudo gem install datamapper
sudo gem install do_sqlite3

OAuth for Ruby:

sudo gem install oauth

OAuth Provider for Ruby:

Since there is no gem yet you will need to do the following: cd lib git clone git://

Thanks to pelle, halorgium (for the auth_provider), and singpolyma (for the simple Sinatra example)! And to the Vancouver "Ruby in the Rain" event for opening my eyes to Sinatra. You guys rock!


Something went wrong with that request. Please try again.