Skip to content

TerraCycleUS/omniauth-terracycle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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 => 'public account_read create_shipment join_brigade list_shipments get_shipping_label',
           :locale => :'en-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

OmniAuth Provider for the Terracycle API v2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages