omniauth-google-oauth2 0.4.1 → 0.5.0
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 +20 -0
- data/.travis.yml +4 -12
- data/CHANGELOG.md +17 -0
- data/Gemfile +2 -4
- data/README.md +85 -83
- data/Rakefile +3 -2
- data/examples/Gemfile +4 -2
- data/examples/config.ru +82 -7
- data/examples/omni_auth.rb +8 -20
- data/lib/omniauth-google-oauth2.rb +3 -1
- data/lib/omniauth/google_oauth2.rb +3 -1
- data/lib/omniauth/google_oauth2/version.rb +3 -1
- data/lib/omniauth/strategies/google_oauth2.rb +64 -52
- data/omniauth-google-oauth2.gemspec +17 -11
- data/spec/omniauth/strategies/google_oauth2_spec.rb +206 -120
- data/spec/rubocop_spec.rb +9 -0
- data/spec/spec_helper.rb +3 -1
- metadata +31 -15
- data/examples/auth.js +0 -43
data/spec/spec_helper.rb
CHANGED
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.5.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:
|
12
|
+
date: 2017-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 1.5
|
48
|
+
version: '1.5'
|
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.5
|
55
|
+
version: '1.5'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: multi_json
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -71,31 +71,46 @@ dependencies:
|
|
71
71
|
name: rspec
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - "
|
74
|
+
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
76
|
+
version: '3.6'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: '3.6'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: rake
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- - "
|
88
|
+
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '0'
|
90
|
+
version: '12.0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- - "
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '12.0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: rubocop
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0.49'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
96
110
|
- !ruby/object:Gem::Version
|
97
|
-
version: '0'
|
98
|
-
description: A Google OAuth2 strategy for OmniAuth 1.x
|
111
|
+
version: '0.49'
|
112
|
+
description: A Google OAuth2 strategy for OmniAuth 1.x. This allows you to login to
|
113
|
+
Google with your ruby app.
|
99
114
|
email:
|
100
115
|
- quest@mac.com
|
101
116
|
executables: []
|
@@ -103,13 +118,13 @@ extensions: []
|
|
103
118
|
extra_rdoc_files: []
|
104
119
|
files:
|
105
120
|
- ".gitignore"
|
121
|
+
- ".rubocop.yml"
|
106
122
|
- ".travis.yml"
|
107
123
|
- CHANGELOG.md
|
108
124
|
- Gemfile
|
109
125
|
- README.md
|
110
126
|
- Rakefile
|
111
127
|
- examples/Gemfile
|
112
|
-
- examples/auth.js
|
113
128
|
- examples/config.ru
|
114
129
|
- examples/omni_auth.rb
|
115
130
|
- lib/omniauth-google-oauth2.rb
|
@@ -118,6 +133,7 @@ files:
|
|
118
133
|
- lib/omniauth/strategies/google_oauth2.rb
|
119
134
|
- omniauth-google-oauth2.gemspec
|
120
135
|
- spec/omniauth/strategies/google_oauth2_spec.rb
|
136
|
+
- spec/rubocop_spec.rb
|
121
137
|
- spec/spec_helper.rb
|
122
138
|
homepage: https://github.com/zquestz/omniauth-google-oauth2
|
123
139
|
licenses:
|
@@ -139,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
155
|
version: '0'
|
140
156
|
requirements: []
|
141
157
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
158
|
+
rubygems_version: 2.6.11
|
143
159
|
signing_key:
|
144
160
|
specification_version: 4
|
145
161
|
summary: A Google OAuth2 strategy for OmniAuth 1.x
|
data/examples/auth.js
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
// Basic hybrid auth example following the pattern at:
|
2
|
-
// https://developers.google.com/api-client-library/javascript/features/authentication#Authexample
|
3
|
-
jQuery(function() {
|
4
|
-
return $.ajax({
|
5
|
-
url: 'https://apis.google.com/js/client:plus.js?onload=gpAsyncInit',
|
6
|
-
dataType: 'script',
|
7
|
-
cache: true
|
8
|
-
});
|
9
|
-
});
|
10
|
-
|
11
|
-
window.gpAsyncInit = function() {
|
12
|
-
gapi.auth.authorize({
|
13
|
-
immediate: true,
|
14
|
-
response_type: 'code',
|
15
|
-
cookie_policy: 'single_host_origin',
|
16
|
-
client_id: 'YOUR_CLIENT_ID',
|
17
|
-
scope: 'email profile'
|
18
|
-
}, function(response) {
|
19
|
-
return;
|
20
|
-
});
|
21
|
-
$('.googleplus-login').click(function(e) {
|
22
|
-
e.preventDefault();
|
23
|
-
gapi.auth.authorize({
|
24
|
-
immediate: false,
|
25
|
-
response_type: 'code',
|
26
|
-
cookie_policy: 'single_host_origin',
|
27
|
-
client_id: 'YOUR_CLIENT_ID',
|
28
|
-
scope: 'email profile'
|
29
|
-
}, function(response) {
|
30
|
-
if (response && !response.error) {
|
31
|
-
// google authentication succeed, now post data to server.
|
32
|
-
jQuery.ajax({type: 'POST', url: "/auth/google_oauth2/callback",
|
33
|
-
data: response,
|
34
|
-
success: function(data) {
|
35
|
-
// response from server
|
36
|
-
}
|
37
|
-
});
|
38
|
-
} else {
|
39
|
-
// google authentication failed
|
40
|
-
}
|
41
|
-
});
|
42
|
-
});
|
43
|
-
};
|