An Omniauth strategy for Trello's OAuth 1.0 authentication.
Read the Trello API documentation for more information on obtaining an application key and secret.
Add this line to your application's Gemfile:
gem 'omniauth-trello'
And then bundle:
$ bundle
Or install it yourself as:
$ gem install omniauth-trello
OmniAuth::Strategies::Trello
is a Rack middleware strategy for the OmniAuth gem. Look at the OmniAuth project page for more information on how to use OmniAuth.
Place this into config/initializers/omniauth.rb
:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :trello, ENV['TRELLO_KEY'], ENV['TRELLO_SECRET'],
app_name: "APP_NAME", scope: 'read,write,account', expiration: 'never'
end
The scope
argument defaults to 'read'.
Specify other scopes with a comma separated string (no spaces), example: 'read,write,account'
- Read all of your boards and organizations
- Create and update cards, lists and boards
- Make comments for you
- Read your email address
Contrary to Trello's documentation, user email is only given when using the read,write,account
or read,account
scope.
expiration
if omitted, it defaults to 30 days (Trello default). You can use arguments like: "never", "1day", "30days"
If you don't specify 'never', Trello will ask for user approval on every subsequent login and application will duplicate on the user's account settings page in Trello. I recommend using the never
scope.
More info in the Trello docs
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request