OmniAuth::Storenvy is Rack middleware. Below are examples written specifically for Rails 3.1+, however it can be used in other frameworks based off of Rack (Sinatra, etc). See the OmniAuth docs for detailed usage examples.
Create an initializer file, and tell OmniAuth you'd like to register Storenvy as a provider:
Rails.application.config.middleware.use OmniAuth::Builder do provider :storenvy, ENV['STORENVY_TOKEN'], ENV['STORENVY_SECRET'] end
Optionally, you may also pass in space-separated Permission Scopes:
Rails.application.config.middleware.use OmniAuth::Builder do provider :storenvy, ENV['STORENVY_TOKEN'], ENV['STORENVY_SECRET'], :scope => 'user store_read store_write' end
Add OmniAuth and OmniAuth::Storenvy to your application's Gemfile:
gem 'omniauth', '~>1.0' gem 'omniauth-storenvy', '~>0.1.0'
And then execute:
Or install it yourself as:
$ gem install omniauth $ gem install omniauth-storenvy
OmniAuth::Storenvy has only been test on Ruby 1.9.2
Check out a super-simple Sinatra example here.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request