omniauth-google-oauth2 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +11 -1
- data/CHANGELOG.md +15 -0
- data/README.md +4 -2
- data/examples/Gemfile +1 -1
- data/lib/omniauth/google_oauth2/version.rb +1 -1
- data/lib/omniauth/strategies/google_oauth2.rb +1 -1
- data/spec/omniauth/strategies/google_oauth2_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb54f22683d8785746e4da71576b5f84cf2f654961879dc10c2585b61ac27e6
|
4
|
+
data.tar.gz: 32dd7cb7faaece80dd26f9675f2cd46fc20d39531a2230d24709296fa53cf1bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aebca15a4956422c94af941328c51007a4bf0d461fe109586ae90b4dddcfdc0acd8cc7a6abade1589986866040962be3457ab3ab4c27ebfbe3a390d15e1f0a38
|
7
|
+
data.tar.gz: 8d2a97f39e08ee8f8ccb00e6b9d7bdb6d9d96d26097ad36ca7486ba9f41a2671fa77c3b19628c83aa475a939c01331539df468d1280bc990927fc0e5475a3fe7
|
data/.rubocop.yml
CHANGED
@@ -6,7 +6,7 @@ Metrics/BlockLength:
|
|
6
6
|
ExcludedMethods: ['describe', 'context', 'shared_examples']
|
7
7
|
Metrics/CyclomaticComplexity:
|
8
8
|
Enabled: false
|
9
|
-
|
9
|
+
Layout/LineLength:
|
10
10
|
Enabled: false
|
11
11
|
Metrics/MethodLength:
|
12
12
|
Enabled: false
|
@@ -18,3 +18,13 @@ Style/MutableConstant:
|
|
18
18
|
Enabled: false
|
19
19
|
Gemspec/RequiredRubyVersion:
|
20
20
|
Enabled: false
|
21
|
+
Lint/RaiseException:
|
22
|
+
Enabled: false
|
23
|
+
Lint/StructNewOverride:
|
24
|
+
Enabled: false
|
25
|
+
Style/HashEachMethods:
|
26
|
+
Enabled: false
|
27
|
+
Style/HashTransformKeys:
|
28
|
+
Enabled: false
|
29
|
+
Style/HashTransformValues:
|
30
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## 1.1.3 - 2024-08-29
|
5
|
+
|
6
|
+
### Added
|
7
|
+
- Updated to use POST instead of GET for tokeninfo endpoint.
|
8
|
+
|
9
|
+
### Deprecated
|
10
|
+
- Nothing.
|
11
|
+
|
12
|
+
### Removed
|
13
|
+
- Nothing.
|
14
|
+
|
15
|
+
### Fixed
|
16
|
+
- Documentation typos.
|
17
|
+
- Rubocop configuration updates.
|
18
|
+
|
4
19
|
## 1.1.2 - 2024-03-28
|
5
20
|
|
6
21
|
### Added
|
data/README.md
CHANGED
@@ -40,7 +40,7 @@ You can now access the OmniAuth Google OAuth2 URL: `/auth/google_oauth2`
|
|
40
40
|
|
41
41
|
For more examples please check out `examples/omni_auth.rb`
|
42
42
|
|
43
|
-
[Using Devise? Skip the above and jump down to the Devise section!](#devise) After setting up the provider via Devise, you can reference the
|
43
|
+
[Using Devise? Skip the above and jump down to the Devise section!](#devise) After setting up the provider via Devise, you can reference the configurations below.
|
44
44
|
|
45
45
|
NOTE: While developing your application, if you change the scope in the initializer you will need to restart your app server. Remember that either the 'email' or 'profile' scope is required!
|
46
46
|
|
@@ -205,6 +205,8 @@ end
|
|
205
205
|
and bind to or create the user
|
206
206
|
|
207
207
|
```ruby
|
208
|
+
# app/models/user.rb
|
209
|
+
|
208
210
|
def self.from_omniauth(access_token)
|
209
211
|
data = access_token.info
|
210
212
|
user = User.where(email: data['email']).first
|
@@ -233,7 +235,7 @@ For your views you can login using:
|
|
233
235
|
<%= link_to "Sign in with Google", user_omniauth_authorize_path(:google_oauth2) %>
|
234
236
|
```
|
235
237
|
|
236
|
-
An overview is available at https://github.com/
|
238
|
+
An overview is available at https://github.com/heartcombo/devise/wiki/OmniAuth:-Overview
|
237
239
|
|
238
240
|
### One-time Code Flow (Hybrid Authentication)
|
239
241
|
|
data/examples/Gemfile
CHANGED
@@ -231,7 +231,7 @@ module OmniAuth
|
|
231
231
|
return nil unless access_token
|
232
232
|
|
233
233
|
@token_info ||= Hash.new do |h, k|
|
234
|
-
h[k] = client.request(:
|
234
|
+
h[k] = client.request(:post, 'https://www.googleapis.com/oauth2/v3/tokeninfo', body: { access_token: access_token }).parsed
|
235
235
|
end
|
236
236
|
|
237
237
|
@token_info[access_token]
|
@@ -384,7 +384,7 @@ describe OmniAuth::Strategies::GoogleOauth2 do
|
|
384
384
|
subject.options.client_options[:connection_build] = proc do |builder|
|
385
385
|
builder.request :url_encoded
|
386
386
|
builder.adapter :test do |stub|
|
387
|
-
stub.
|
387
|
+
stub.post('/oauth2/v3/tokeninfo', 'access_token=valid_access_token') do
|
388
388
|
[200, { 'Content-Type' => 'application/json; charset=UTF-8' }, JSON.dump(
|
389
389
|
aud: '000000000000.apps.googleusercontent.com',
|
390
390
|
sub: '123456789',
|
@@ -781,7 +781,7 @@ describe OmniAuth::Strategies::GoogleOauth2 do
|
|
781
781
|
subject.options.client_options[:connection_build] = proc do |builder|
|
782
782
|
builder.request :url_encoded
|
783
783
|
builder.adapter :test do |stub|
|
784
|
-
stub.
|
784
|
+
stub.post('/oauth2/v3/tokeninfo', 'access_token=valid_access_token') do
|
785
785
|
[200, { 'Content-Type' => 'application/json; charset=UTF-8' }, JSON.dump(
|
786
786
|
aud: '000000000000.apps.googleusercontent.com',
|
787
787
|
sub: '123456789',
|
@@ -792,7 +792,7 @@ describe OmniAuth::Strategies::GoogleOauth2 do
|
|
792
792
|
expires_in: 436
|
793
793
|
)]
|
794
794
|
end
|
795
|
-
stub.
|
795
|
+
stub.post('/oauth2/v3/tokeninfo', 'access_token=invalid_access_token') do
|
796
796
|
[400, { 'Content-Type' => 'application/json; charset=UTF-8' }, JSON.dump(error_description: 'Invalid Value')]
|
797
797
|
end
|
798
798
|
end
|
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: 1.1.
|
4
|
+
version: 1.1.3
|
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: 2024-
|
12
|
+
date: 2024-08-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jwt
|