OmniAuth strategy for authenticating to Fitbit using their OAuth API.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
lib
spec
.gitignore
.travis.yml
Gemfile
LICENSE.md
README.md
Rakefile
omniauth-fitbit.gemspec

README.md

OmniAuth Fitbit Strategy Build Status

This gem is an OmniAuth 1.0+ Strategy for the Fitbit API.

Latest

Version 2.0.0 was released to rubygems with support for OAuth 2. The new version requires Ruby 2+.

Usage

Add the strategy to your Gemfile:

gem 'omniauth-fitbit'

Then integrate the strategy into your middleware:

use OmniAuth::Builder do
  provider :fitbit, 'consumer_key', 'consumer_secret'
end

In Rails, create a new file under config/initializers called omniauth.rb to plug the strategy into your middleware stack.

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :fitbit, 'consumer_key', 'consumer_secret'
end

With OAuth 2.0, the additional URI parameter of 'scope' (a space-delimited list of the permissions you are requesting) is required, and should be included in the strategy as well.

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :fitbit, 'consumer_key', 'consumer_secret', scope: "activity profile"
end

To register your application with Fitbit and obtain a consumer key and secret, go to the Fitbit application registration.

For additional information about OmniAuth, visit OmniAuth wiki.

For a short tutorial on how to use OmniAuth in your Rails application, visit this tutsplus.com tutorial.

Copyright

Copyright (c) 2016 TK Gospodinov. See LICENSE for details.