OmniAuth::OCTanner
This wonderful gem adds a simple provider for OAuth2 to OmniAuth so you can hit the EVE auth service with relative ease.
Installation
Add this line to your application's Gemfile:
gem 'omniauth-oc_tanner'
And then execute:
$ bundle
Or install it yourself as:
$ gem install omniauth-oc_tanner
Usage
Rails applications
Create an initializer (ex: config/initializers/omniauth.rb) and use that to
add the OmniAuth provider to the middleware stack.
require 'omniauth/oc_tanner'
Rails.application.config.middleware.use(OmniAuth::Builder) do
provider :oc_tanner, 'your_client_id', 'your_client_key'
end
Replace your_client_id and your_client_key with your own settings and you
should be set to go. You can hit http://your_awesome_site/auth/oc-tanner and it should
redirect you to authenticate with EVE. Note, however, that there's nothing out
of the box to handle the callback URL (/auth/oc-tanner/callback by default),
so you'll need to route and handle that yourself.
Essentially, this entails processing the data that the authentication service
passes back to you via the request.env['omniauth.auth'] variable in any
controller action. There are ample examples of this in the OmniAuth
Documentation
that can get you on the right track.
Contributing
- 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