OmniAuth sQuiddio
Work in Progress
This gem is an OmniAuth Strategy for the Squiddio API which uses OAuth 2.0
Usage
Obtain app key and secret (SQUIDDIO_KEY, SQUIDDIO_SECRET):
- Create a sQuidd.io account at http://squidd.io/signup if you don't already have one.
- Create a Boat (app credentials are associated to a user's vessel, not the user, in case you own/manage multiple vessels).
- Update your boat's current position (some of the sample API requests require a known vessel position).
- Finally, go to your boat's page and click "Edit Boat Profile". You can find the ID and Secret in the APIs Tab. More info in the Getting Started Guide and FAQ
Add the strategy to your Gemfile
alongside OmniAuth:
gem 'omniauth'
gem 'omniauth-squiddio'
Then, to integrate the strategy into your middleware, add this to your omniauth.rb settings file:
use OmniAuth::Builder do
provider :squiddio, ENV['SQUIDDIO_KEY'], ENV['SQUIDDIO_SECRET']
end
In Rails, you'll want to add to the middleware stack:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :squiddio, ENV['SQUIDDIO_KEY'], ENV['SQUIDDIO_SECRET']
end
If you use Devise:
Devise.setup do |config|
config.omniauth :squiddio, ENV['SQUIDDIO_KEY'], ENV['SQUIDDIO__SECRET']
end
For additional information, refer to the OmniAuth wiki.