omniauth-fitbit-oauth2 0.0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdcf3a2f76bad287cc9dbeccef7692c15ab260da
4
- data.tar.gz: 83b9db84c215c64882361cecad505a21fdea2ae3
3
+ metadata.gz: 56c0c630eb0d738340df55603150dc4a54375b04
4
+ data.tar.gz: c4e71f57ab4088bb1f6613bb7dfe0da6dff7ba46
5
5
  SHA512:
6
- metadata.gz: 98586420ee60eb52bad0e53f61f5c54db69a54cb5994b0d9dd3d0e6c7b9abfe639fa13c12019ff7edb07a2cc75dbf5afd678ec68dbe91359ecb0b5bf8863c55f
7
- data.tar.gz: 5c3447dcbc9067e83be290d1c66e98ad9520dd64a62df63c9895f50d57cee5148f652b45067a600c194a9c97493da123944a1076441405557e6c5e079b1b7a65
6
+ metadata.gz: 55dea08f72daa99066ff3a06bfaf9a009ba0e55fecb88bdf87f175980e59b6e1f2a46ea6208a67a6bd2b87c69a00d990c0b38f5151faa6978a74de13558ae303
7
+ data.tar.gz: 320904b870732254b0cbef1c4dc24d0753914e40d8edc02177e5ca7c7bf98603030a5baf014abf8a72a9aab78085fbfaf898ededf0eb008c43ed896a73cb7209
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # OmniAuth OAuth2 strategy for Fitbit
2
- This gem is an OAuth2 OmniAuth Strategy for the [Fitbit API](https://wiki.fitbit.com/display/API/OAuth+2.0).
2
+ This gem is an OAuth2 OmniAuth Strategy for the [Fitbit API](https://dev.fitbit.com/docs/oauth2/).
3
+
4
+ ## Gem Status
5
+ [![Gem Version](https://badge.fury.io/rb/omniauth-fitbit-oauth2.svg)](http://badge.fury.io/rb/omniauth-fitbit-oauth2)
6
+ [![Build Status](https://semaphoreci.com/api/v1/projects/2fae3e5c-5bb1-4cf6-8d58-de1656ff3751/425290/shields_badge.svg)](https://semaphoreci.com/codebender/omniauth-fitbit-oauth2)
3
7
 
4
8
  ## Installing
5
9
 
File without changes
@@ -22,7 +22,8 @@ use Rack::Session::Cookie
22
22
 
23
23
  use OmniAuth::Builder do
24
24
  provider :fitbit_oauth2, ENV['FITBIT_CLIENT_ID'], ENV['FITBIT_CLIENT_SECRET'],
25
- :scope => 'activity sleep'
25
+ :scope => 'profile activity sleep', :expires_in => '2592000',
26
+ :prompt => 'login'
26
27
  end
27
28
 
28
29
  run App.new
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module FitbitOauth2
3
- VERSION = '0.0.1'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
@@ -13,7 +13,7 @@ module OmniAuth
13
13
  :token_url => 'https://api.fitbit.com/oauth2/token'
14
14
  }
15
15
 
16
- option :authorize_options, [:scope, :response_type]
16
+ option :authorize_options, [:scope, :response_type, :expires_in, :prompt]
17
17
  option :response_type, 'code'
18
18
 
19
19
  def build_access_token
@@ -27,6 +27,12 @@ module OmniAuth
27
27
  options[:client_secret]).gsub("\n", '')
28
28
  end
29
29
 
30
+ def query_string
31
+ # The state and code params shouldn't be sent as part of the
32
+ # callback_url in the callback phase
33
+ ''
34
+ end
35
+
30
36
  uid do
31
37
  raw_info['user']['encodedId']
32
38
  end
@@ -57,12 +63,12 @@ module OmniAuth
57
63
 
58
64
  def raw_info
59
65
  if options[:use_english_measure] == 'true'
60
- @raw_info ||= MultiJson.load(access_token.
66
+ @raw_info ||= access_token.
61
67
  request('get', 'https://api.fitbit.com/1/user/-/profile.json',
62
- { 'Accept-Language' => 'en_US' }).body)
68
+ { 'Accept-Language' => 'en_US' }).parsed
63
69
  else
64
- @raw_info ||= MultiJson.load(access_token.
65
- get('https://api.fitbit.com/1/user/-/profile.json').body)
70
+ @raw_info ||= access_token.
71
+ get('https://api.fitbit.com/1/user/-/profile.json').parsed
66
72
  end
67
73
  end
68
74
  end
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.version = OmniAuth::FitbitOauth2::VERSION
7
7
  gem.license = 'MIT'
8
8
  gem.summary = %q{OmniAuth Oauth2 strategy for fitbit.com.}
9
- gem.description = %q{OmniAuth Oauth2 strategy for fitbit.com - https://wiki.fitbit.com/display/API/OAuth+2.0}
9
+ gem.description = %q{OmniAuth Oauth2 strategy for fitbit.com - https://dev.fitbit.com/docs/oauth2/}
10
10
  gem.author = 'Matthew Bender'
11
11
  gem.email = 'benderm@gmail.com'
12
12
  gem.homepage = 'https://github.com/codebender/omniauth-fitbit-oauth2'
@@ -18,5 +18,5 @@ Gem::Specification.new do |gem|
18
18
 
19
19
  gem.add_runtime_dependency 'omniauth-oauth2', '~> 1.3'
20
20
 
21
- gem.add_development_dependency 'rspec', '~> 3.2'
21
+ gem.add_development_dependency 'rspec', '~> 3.3'
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-fitbit-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Bender
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-15 00:00:00.000000000 Z
11
+ date: 2015-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -30,15 +30,15 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.2'
33
+ version: '3.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.2'
41
- description: OmniAuth Oauth2 strategy for fitbit.com - https://wiki.fitbit.com/display/API/OAuth+2.0
40
+ version: '3.3'
41
+ description: OmniAuth Oauth2 strategy for fitbit.com - https://dev.fitbit.com/docs/oauth2/
42
42
  email: benderm@gmail.com
43
43
  executables: []
44
44
  extensions: []
@@ -48,8 +48,8 @@ files:
48
48
  - Gemfile
49
49
  - LICENSE
50
50
  - README.md
51
- - exmaple/Gemfile
52
- - exmaple/config.ru
51
+ - example/Gemfile
52
+ - example/config.ru
53
53
  - lib/omniauth-fitbit-oauth2.rb
54
54
  - lib/omniauth-fitbit-oauth2/version.rb
55
55
  - lib/omniauth/strategies/fitbit_oauth2.rb
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.4.5
79
+ rubygems_version: 2.4.5.1
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: OmniAuth Oauth2 strategy for fitbit.com.