omniauth-oauth2 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of omniauth-oauth2 might be problematic. Click here for more details.

data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ *.swp
data/README.md CHANGED
@@ -14,7 +14,7 @@ info).
14
14
  To create an OmniAuth OAuth2 strategy using this gem, you can simply
15
15
  subclass it and add a few extra methods like so:
16
16
 
17
- require 'omniauth-oauth'
17
+ require 'omniauth-oauth2'
18
18
 
19
19
  module OmniAuth
20
20
  module Strategies
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module OAuth2
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
@@ -2,6 +2,7 @@ require 'cgi'
2
2
  require 'uri'
3
3
  require 'oauth2'
4
4
  require 'omniauth'
5
+ require 'timeout'
5
6
 
6
7
  module OmniAuth
7
8
  module Strategies
@@ -59,7 +60,7 @@ module OmniAuth
59
60
  end
60
61
 
61
62
  self.access_token = build_access_token
62
- self.access_token = client.auth_code.refresh_token(access_token.refresh_token) if access_token.expired?
63
+ self.access_token = access_token.refresh! if access_token.expired?
63
64
 
64
65
  super
65
66
  rescue ::OAuth2::Error, CallbackError => e
@@ -68,13 +69,15 @@ module OmniAuth
68
69
  fail!(:invalid_response, e)
69
70
  rescue ::Timeout::Error, ::Errno::ETIMEDOUT => e
70
71
  fail!(:timeout, e)
72
+ rescue ::SocketError => e
73
+ fail!(:failed_to_connect, e)
71
74
  end
72
75
 
73
76
  protected
74
77
 
75
78
  def build_access_token
76
79
  verifier = request.params['code']
77
- client.auth_code.get_token(verifier, {:redirect_uri => callback_url}.merge(options.token_params.to_hash(:symbolize_keys => true)))
80
+ client.auth_code.get_token(verifier, {:redirect_uri => callback_url}.merge(token_params.to_hash(:symbolize_keys => true)))
78
81
  end
79
82
 
80
83
  # An error that is indicated in the OAuth 2.0 callback.
@@ -3,7 +3,7 @@ require File.expand_path('../lib/omniauth-oauth2/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.add_dependency 'omniauth', '~> 1.0'
6
- gem.add_dependency 'oauth2', '~> 0.5.0'
6
+ gem.add_dependency 'oauth2', '~> 0.6.0'
7
7
 
8
8
  gem.add_development_dependency 'rspec', '~> 2.7'
9
9
  gem.add_development_dependency 'rack-test'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-02 00:00:00.000000000Z
12
+ date: 2012-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
16
- requirement: &70244359505740 !ruby/object:Gem::Requirement
16
+ requirement: &70168923789820 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,21 +21,21 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70244359505740
24
+ version_requirements: *70168923789820
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: oauth2
27
- requirement: &70244359505120 !ruby/object:Gem::Requirement
27
+ requirement: &70168923788900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: 0.5.0
32
+ version: 0.6.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70244359505120
35
+ version_requirements: *70168923788900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70244359504360 !ruby/object:Gem::Requirement
38
+ requirement: &70168923786760 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '2.7'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70244359504360
46
+ version_requirements: *70168923786760
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rack-test
49
- requirement: &70244359503620 !ruby/object:Gem::Requirement
49
+ requirement: &70168923785800 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70244359503620
57
+ version_requirements: *70168923785800
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: webmock
60
- requirement: &70244359502240 !ruby/object:Gem::Requirement
60
+ requirement: &70168923763660 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70244359502240
68
+ version_requirements: *70168923763660
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
- requirement: &70244359501400 !ruby/object:Gem::Requirement
71
+ requirement: &70168923762320 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70244359501400
79
+ version_requirements: *70168923762320
80
80
  description: An abstract OAuth2 strategy for OmniAuth.
81
81
  email:
82
82
  - michael@intridea.com
@@ -116,10 +116,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  requirements: []
118
118
  rubyforge_project:
119
- rubygems_version: 1.8.10
119
+ rubygems_version: 1.8.11
120
120
  signing_key:
121
121
  specification_version: 3
122
122
  summary: An abstract OAuth2 strategy for OmniAuth.
123
123
  test_files:
124
124
  - spec/omniauth/strategies/oauth2_spec.rb
125
125
  - spec/spec_helper.rb
126
+ has_rdoc: