omniauth-campus 0.4.6 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4c84cc14ebb7fb660df1301b3f96fbc9a37cee3
|
4
|
+
data.tar.gz: a34294796a1ab70357c43525653bff7c7a854e55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c949d2eb0e7922d266d6a9b5e12eb0f42844d65bf7e5aea0f842f80f2787ad5406dd459fa2cb531b51a8ca48e82307aa3c931233c70d4edcb84376165785b3f
|
7
|
+
data.tar.gz: 61d34927f0cb6108f4dbfd76130f0746aff2b4b15198b566dd4b2b6cdabe52cc4af56d5a3e894a70709ad740706f44677e173a6c81bd4edcfef1c05c7513348e
|
Binary file
|
Binary file
|
@@ -30,16 +30,6 @@ module OmniAuth
|
|
30
30
|
|
31
31
|
option :fields, [:name, :email]
|
32
32
|
|
33
|
-
option :auth_token_params, {
|
34
|
-
param_name: 'access_token',
|
35
|
-
mode: :query
|
36
|
-
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
attr_accessor :access_token
|
41
|
-
|
42
|
-
|
43
33
|
|
44
34
|
#site' 'http://community3dev.devcloud.acquia-sites.com/api'
|
45
35
|
|
@@ -50,10 +40,27 @@ module OmniAuth
|
|
50
40
|
#
|
51
41
|
# }
|
52
42
|
#
|
53
|
-
|
54
|
-
|
43
|
+
def request_method
|
44
|
+
if env['REQUEST_METHOD'] == 'GET'
|
45
|
+
get_credentials
|
46
|
+
end
|
47
|
+
end
|
55
48
|
|
49
|
+
def get_credentials
|
50
|
+
form = OmniAuth::Form.new(:title => "User Info")
|
51
|
+
options.fields.each do |field|
|
52
|
+
form.text_field field.to_s.capitalize.gsub("_", " "), field.to_s
|
53
|
+
end
|
54
|
+
form.button "Sign In"
|
55
|
+
form.to_response
|
56
|
+
end
|
56
57
|
|
58
|
+
def consumer
|
59
|
+
consumer = ::OAuth::Consumer.new(options.consumer_key, options.consumer_secret, options.client_options)
|
60
|
+
consumer.http.open_timeout = options.open_timeout if options.open_timeout
|
61
|
+
consumer.http.read_timeout = options.read_timeout if options.read_timeout
|
62
|
+
consumer
|
63
|
+
end
|
57
64
|
|
58
65
|
uid {raw_info['uid']}
|
59
66
|
|
@@ -64,7 +71,7 @@ module OmniAuth
|
|
64
71
|
end
|
65
72
|
|
66
73
|
def raw_info
|
67
|
-
@raw_info ||= MultiJson.decode(
|
74
|
+
@raw_info ||= MultiJson.decode(access_token.get('/me').body )
|
68
75
|
end
|
69
76
|
|
70
77
|
end
|