omniauth-google-oauth2 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +14 -0
- data/README.md +1 -1
- data/examples/Gemfile +1 -1
- data/lib/omniauth/google_oauth2/version.rb +1 -1
- data/lib/omniauth/strategies/google_oauth2.rb +17 -16
- data/omniauth-google-oauth2.gemspec +2 -2
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a035e3c9635a9e588b756e9b2dfe2004ea1b83c49f9860d68e8250e7d93e4459
|
4
|
+
data.tar.gz: 20e8ba4d7f4b9fb20b139c8d4b9c51d8d1d598de1cada5d989640f01eee0df3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b06e6a3ffd03ff81fe6e04bbc94c9154e26c59dc17a7c834361bf2fdd80197661434679e8174196f4dd8ed13e4b2b81ff4b223fb366238f48648ea452fcf1ce
|
7
|
+
data.tar.gz: 4734f0d6f92b57cebfccbbd0b833a7da9674d04e9058b76ef43d96cd94520a48bd540f57c9f804f6b16f2bad76483aefb3ef7357a99186acfc4dcb1603fa3a28
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,20 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## 0.8.0 - 2019-08-21
|
5
|
+
|
6
|
+
### Added
|
7
|
+
- Updated omniauth-oauth2 to v1.6.0 for security fixes.
|
8
|
+
|
9
|
+
### Deprecated
|
10
|
+
- Nothing.
|
11
|
+
|
12
|
+
### Removed
|
13
|
+
- Ruby 2.1 support.
|
14
|
+
|
15
|
+
### Fixed
|
16
|
+
- Nothing.
|
17
|
+
|
4
18
|
## 0.7.0 - 2019-06-03
|
5
19
|
|
6
20
|
### Added
|
data/README.md
CHANGED
@@ -73,7 +73,7 @@ You can configure several options, which you pass in to the `provider` method vi
|
|
73
73
|
|
74
74
|
* `hd`: (Optional) Limit sign-in to a particular Google Apps hosted domain. This can be simply string `'domain.com'` or an array `%w(domain.com domain.co)`. More information at: https://developers.google.com/accounts/docs/OpenIDConnect#hd-param
|
75
75
|
|
76
|
-
* `jwt_leeway`: Number of seconds passed to the JWT library as leeway. Defaults to 60 seconds.
|
76
|
+
* `jwt_leeway`: Number of seconds passed to the JWT library as leeway. Defaults to 60 seconds. Note this only works if you use jwt 2.1, as the leeway option was removed in later versions.
|
77
77
|
|
78
78
|
* `skip_jwt`: Skip JWT processing. This is for users who are seeing JWT decoding errors with the `iat` field. Always try adjusting the leeway before disabling JWT processing.
|
79
79
|
|
data/examples/Gemfile
CHANGED
@@ -94,6 +94,7 @@ module OmniAuth
|
|
94
94
|
verify_hd(access_token)
|
95
95
|
access_token
|
96
96
|
end
|
97
|
+
|
97
98
|
alias build_access_token custom_build_access_token
|
98
99
|
|
99
100
|
private
|
@@ -103,14 +104,12 @@ module OmniAuth
|
|
103
104
|
end
|
104
105
|
|
105
106
|
def get_access_token(request)
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
elsif
|
111
|
-
verifier
|
112
|
-
redirect_uri = request.params['redirect_uri']
|
113
|
-
client.auth_code.get_token(verifier, get_token_options(redirect_uri), deep_symbolize(options.auth_token_params || {}))
|
107
|
+
verifier = request.params['code']
|
108
|
+
redirect_uri = request.params['redirect_uri']
|
109
|
+
if verifier && request.xhr?
|
110
|
+
client_get_token(verifier, redirect_uri || 'postmessage')
|
111
|
+
elsif verifier
|
112
|
+
client_get_token(verifier, redirect_uri || callback_url)
|
114
113
|
elsif verify_token(request.params['access_token'])
|
115
114
|
::OAuth2::AccessToken.from_hash(client, request.params.dup)
|
116
115
|
elsif request.content_type =~ /json/i
|
@@ -118,19 +117,21 @@ module OmniAuth
|
|
118
117
|
body = JSON.parse(request.body.read)
|
119
118
|
request.body.rewind # rewind request body for downstream middlewares
|
120
119
|
verifier = body && body['code']
|
121
|
-
if verifier
|
122
|
-
redirect_uri = 'postmessage'
|
123
|
-
client.auth_code.get_token(verifier, get_token_options(redirect_uri), deep_symbolize(options.auth_token_params || {}))
|
124
|
-
end
|
120
|
+
client_get_token(verifier, 'postmessage') if verifier
|
125
121
|
rescue JSON::ParserError => e
|
126
122
|
warn "[omniauth google-oauth2] JSON parse error=#{e}"
|
127
123
|
end
|
128
|
-
else
|
129
|
-
verifier = request.params['code']
|
130
|
-
client.auth_code.get_token(verifier, get_token_options(callback_url), deep_symbolize(options.auth_token_params))
|
131
124
|
end
|
132
125
|
end
|
133
126
|
|
127
|
+
def client_get_token(verifier, redirect_uri)
|
128
|
+
client.auth_code.get_token(verifier, get_token_options(redirect_uri), get_token_params)
|
129
|
+
end
|
130
|
+
|
131
|
+
def get_token_params
|
132
|
+
deep_symbolize(options.auth_token_params || {})
|
133
|
+
end
|
134
|
+
|
134
135
|
def get_scope(params)
|
135
136
|
raw_scope = params[:scope] || DEFAULT_SCOPE
|
136
137
|
scope_list = raw_scope.split(' ').map { |item| item.split(',') }.flatten
|
@@ -142,7 +143,7 @@ module OmniAuth
|
|
142
143
|
raw_info['email_verified'] ? raw_info['email'] : nil
|
143
144
|
end
|
144
145
|
|
145
|
-
def get_token_options(redirect_uri)
|
146
|
+
def get_token_options(redirect_uri = '')
|
146
147
|
{ redirect_uri: redirect_uri }.merge(token_params.to_hash(symbolize_keys: true))
|
147
148
|
end
|
148
149
|
|
@@ -18,11 +18,11 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.files = `git ls-files`.split("\n")
|
19
19
|
gem.require_paths = ['lib']
|
20
20
|
|
21
|
-
gem.required_ruby_version = '>= 2.
|
21
|
+
gem.required_ruby_version = '>= 2.2'
|
22
22
|
|
23
23
|
gem.add_runtime_dependency 'jwt', '>= 2.0'
|
24
24
|
gem.add_runtime_dependency 'omniauth', '>= 1.1.1'
|
25
|
-
gem.add_runtime_dependency 'omniauth-oauth2', '>= 1.
|
25
|
+
gem.add_runtime_dependency 'omniauth-oauth2', '>= 1.6'
|
26
26
|
|
27
27
|
gem.add_development_dependency 'rake', '~> 12.0'
|
28
28
|
gem.add_development_dependency 'rspec', '~> 3.6'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-google-oauth2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Ellithorpe
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-08-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jwt
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '1.
|
48
|
+
version: '1.6'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '1.
|
55
|
+
version: '1.6'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rake
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -133,14 +133,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
133
133
|
requirements:
|
134
134
|
- - ">="
|
135
135
|
- !ruby/object:Gem::Version
|
136
|
-
version: '2.
|
136
|
+
version: '2.2'
|
137
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
138
|
requirements:
|
139
139
|
- - ">="
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
|
143
|
+
rubyforge_project:
|
144
|
+
rubygems_version: 2.7.9
|
144
145
|
signing_key:
|
145
146
|
specification_version: 4
|
146
147
|
summary: A Google OAuth2 strategy for OmniAuth 1.x
|