simple_google_auth 0.0.2 → 0.0.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/README.md +2 -1
- data/lib/simple_google_auth.rb +8 -7
- data/lib/simple_google_auth/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcd5253d85dbfae15e49437bccbc6c71a2378724
|
4
|
+
data.tar.gz: f68e5ca3c49f4d50b20f4b25b718cce90741ddc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c675c5839c74642a96bca3448722459496ada890fb924befce1a346ea132b4a06b08e3c0a7b0ebd39921c4ec4ee9f43f1c3758849ab62a279f6e83428e0f699
|
7
|
+
data.tar.gz: a7425dca68d411514d21bd49737f3752a4659bb0a347035df39de9f3fabb1b4770f9f76b5812f23bcd8a94ea9676f667915f53024c843a16aeb101c5488dbafc
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ This is a dead simple gem that allows you to require a Google login for parts of
|
|
6
6
|
You can allow any user with a Google account, or limit access to certain users based on their
|
7
7
|
Google e-mail address.
|
8
8
|
|
9
|
-
Being simple, it's
|
9
|
+
Being simple, it's limited in what it can do. But if your goal is to put your site
|
10
10
|
behind a Google login instead of a crusty basic auth box, it'll do the trick.
|
11
11
|
If you're after more power, there are quite a few gems that'll do what you're looking for,
|
12
12
|
such as OmniAuth's Google strategy.
|
@@ -86,6 +86,7 @@ google_auth_url | `"https://accounts.google.com/o/oauth2/auth"` | Google's authe
|
|
86
86
|
google_token_url | `"https://accounts.google.com/o/oauth2/token"` | Google's token URL.
|
87
87
|
state_session_key_name | `"simple-google-auth.state"` | The name of the session variable used to store a random string used to prevent CSRF attacks during authentication.
|
88
88
|
data_session_key_name | `"simple-google-auth.data"` | The name of the session variable used to store identification data from Google.
|
89
|
+
request_parameters | {scope: "openid email"} | Parameters to use when requesting a login from Google
|
89
90
|
|
90
91
|
## Licence
|
91
92
|
|
data/lib/simple_google_auth.rb
CHANGED
@@ -12,7 +12,8 @@ module SimpleGoogleAuth
|
|
12
12
|
:google_auth_url,
|
13
13
|
:google_token_url,
|
14
14
|
:state_session_key_name,
|
15
|
-
:data_session_key_name
|
15
|
+
:data_session_key_name,
|
16
|
+
:request_parameters
|
16
17
|
)
|
17
18
|
|
18
19
|
mattr_accessor :config
|
@@ -23,13 +24,12 @@ module SimpleGoogleAuth
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def self.uri(state)
|
26
|
-
query =
|
27
|
+
query = config.request_parameters.merge(
|
27
28
|
response_type: "code",
|
28
|
-
client_id:
|
29
|
-
redirect_uri:
|
30
|
-
|
31
|
-
|
32
|
-
}
|
29
|
+
client_id: config.client_id,
|
30
|
+
redirect_uri: config.redirect_uri,
|
31
|
+
state: state
|
32
|
+
)
|
33
33
|
|
34
34
|
"#{config.google_auth_url}?" + query.map {|k, v| "#{k}=#{CGI.escape v}"}.join("&")
|
35
35
|
end
|
@@ -42,6 +42,7 @@ SimpleGoogleAuth.configure do |config|
|
|
42
42
|
config.state_session_key_name = "simple-google-auth.state"
|
43
43
|
config.data_session_key_name = "simple-google-auth.data"
|
44
44
|
config.failed_login_path = "/"
|
45
|
+
config.request_parameters = {scope: "openid email"}
|
45
46
|
config.authenticate = lambda { raise "You must define an authenticate lambda that sets the session" }
|
46
47
|
end
|
47
48
|
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_google_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.2.0
|
27
27
|
description: An extremely easy way to protect your site by requiring Google logins
|
@@ -32,15 +32,15 @@ executables: []
|
|
32
32
|
extensions: []
|
33
33
|
extra_rdoc_files: []
|
34
34
|
files:
|
35
|
+
- MIT-LICENSE
|
36
|
+
- README.md
|
37
|
+
- Rakefile
|
35
38
|
- config/routes.rb
|
39
|
+
- lib/simple_google_auth.rb
|
36
40
|
- lib/simple_google_auth/controller.rb
|
37
41
|
- lib/simple_google_auth/engine.rb
|
38
42
|
- lib/simple_google_auth/receiver.rb
|
39
43
|
- lib/simple_google_auth/version.rb
|
40
|
-
- lib/simple_google_auth.rb
|
41
|
-
- MIT-LICENSE
|
42
|
-
- Rakefile
|
43
|
-
- README.md
|
44
44
|
homepage: https://github.com/mogest/simple_google_auth
|
45
45
|
licenses:
|
46
46
|
- MIT
|
@@ -51,17 +51,17 @@ require_paths:
|
|
51
51
|
- lib
|
52
52
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
requirements: []
|
63
63
|
rubyforge_project:
|
64
|
-
rubygems_version: 2.
|
64
|
+
rubygems_version: 2.2.2
|
65
65
|
signing_key:
|
66
66
|
specification_version: 4
|
67
67
|
summary: Super simple Google authentication for your Rails site
|