Skip to content

TerraCycle/omniauth-terracycle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OmniAuth Terracycle

This is the official OmniAuth strategy for authenticating to TerraCycle. To use it, you'll need to set up an OAuth2 application on the TerraCycle Developer Portal's Applications page.

Be sure you set up the application at the country's Developer Portal you want to access data from. For example, an appliction created at the TerraCycle France's Developer Portal will only be able to access data from our French website!

Installation

Add this line to your application's Gemfile:

gem 'omniauth-terracycle'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omniauth-terracycle

Usage

use OmniAuth::Builder do
  provider :terracycle, ENV['TERRACYCLE_APP_KEY'], ENV['TERRACYCLE_APP_SECRET'],
           :scope => 'account_read join_brigade leave_brigade',
           :country_code => :us
end

If you indend to use omniauth-terracycle with Devise, be sure to read their OmniAuth Guide.

Configuration

Config options can be passed to provider via a Hash:

scope: A space-separated list of permissions.

country_code: By default the strategy uses TerraCycle USA site. The country_code param must be provided if you want to target another TerraCycle country.

For the full list of country codes check out lib/omniauth-terracycle/country.rb

Contributing

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

About

Authenticate to TerraCycle using its OAuth 2.0 API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages