g_ruby 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/g_ruby/auth.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93390e5ec73db632c31f423ec3efc99bcbd64d09
|
4
|
+
data.tar.gz: 20da34e0fe5552b8c17bdf02541fad6623c24792
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 215a95462860572f39d2499e2d907cb8b40c2e6d4508945583517489b4d8bda1613091cc4d69def63f99c2d18fac048e7fc243df123aa2ff17bb2832fd3330fc
|
7
|
+
data.tar.gz: be4e118be18f2d221cf285c0cc6cc044dabb59b518ba31cf23e331ce21d5aaf90ac73756ffbea2be0b42d9b38ceb353e0e15f33a3a45b5f9fe40b204d0f9cab3
|
data/lib/g_ruby/auth.rb
CHANGED
@@ -8,6 +8,13 @@ class GRuby::Auth
|
|
8
8
|
a = a + "&state=#{state}" if !state.blank?
|
9
9
|
return a
|
10
10
|
end
|
11
|
+
|
12
|
+
#GRuby::Auth.oauth2(state)
|
13
|
+
def self.oauth2(state, scope)
|
14
|
+
a = "https://accounts.google.com/o/oauth2/auth?response_type=code&access_type=offline&approval_prompt=auto&client_id=#{GOOGLE_CLIENTID}&redirect_uri=#{GOOGLE_CALLBACK}&scope=#{scope}"
|
15
|
+
a = a + "&state=#{state}" if !state.blank?
|
16
|
+
return a
|
17
|
+
end
|
11
18
|
|
12
19
|
#GRuby::Auth.token(auth_code)
|
13
20
|
def self.token(auth_code)
|