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 execute:
$ 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.
###Rails Example
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', expiration: '1day'
end
scope
if omitted, it defaults to "read". Or it can have the value "read,write"
expiration
if omitted, it defaults to 30 days (Trello default). Or it can have the values: "never", "1day", "30days"
More info in the Trello docs
Any help with these would be appreciated:
- #1: For some user authentications, the raw info returned from Trello has a null value for email
- #2: The
app_name
authorization is correctly showing up at the Trello authorization page as thename
parameter per the documentation, however Trello still displays "An Unknown Application"
- 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