omniauth-campus 0.0.7 → 0.0.8
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f13f7355771da8d22c51d987e9a60eb441fd2eef
|
|
4
|
+
data.tar.gz: 2d0dd935f392b2bab3fe3473724c36d3cd9838f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a0471f079933c61dd75d2121da1b29ea40c520c0a2f7a15c9da6732fbd6addf6250567e5a1213b8bd24f227793404b066e62f9b4eda574e9652a043235743cc5
|
|
7
|
+
data.tar.gz: be1b34bddda7184e4f0d69292bcfa393b3e9a2c24bead47f2aee6f2d9e90a2ea6cb1f7286f46ad90ee3f4d72d9a5983f65cdcf98dc5aa7d2e4da5d2f092cf909
|
|
Binary file
|
|
@@ -25,61 +25,23 @@ module OmniAuth
|
|
|
25
25
|
|
|
26
26
|
attr_reader :access_tokens
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
consumer = ::OAuth::Consumer.new(options.consumer_key, options.consumer_secret, options.client_options)
|
|
30
|
-
consumer.http.open_timeout = options.open_timeout if options.open_timeout
|
|
31
|
-
consumer.http.read_timeout = options.read_timeout if options.read_timeout
|
|
32
|
-
end
|
|
28
|
+
uid{ raw_info['id'] }
|
|
33
29
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if request_token.callback_confirmed?
|
|
40
|
-
redirect request_token.authorize_url(options[:authorize_params])
|
|
41
|
-
else
|
|
42
|
-
redirect request_token.authorize_url(options[:authorize_params].merge(:oauth_callback => callback_url))
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
rescue ::Timeout::Error => e
|
|
46
|
-
fail!(:timeout, e)
|
|
47
|
-
rescue ::Net::HTTPFatalError, ::OpenSSL::SSL::SSLError => e
|
|
48
|
-
fail!(:service_unavailable, e)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def callback_phase
|
|
52
|
-
raise OmniAuth::NoSessionError.new("Session Expired") if session['campus'].nil?
|
|
53
|
-
|
|
54
|
-
request_token = ::Oauth::RequestToken.new(consumer, session['campus'][name.to_s].delete('request_token'), session['campus'][name.to_s].delete('request_secret'))
|
|
55
|
-
|
|
56
|
-
opts = {}
|
|
57
|
-
if session['campus'][name.to_s]['callback_confirmed']
|
|
58
|
-
opts[:oauth_verifier] = request['oauth_verifier']
|
|
59
|
-
else
|
|
60
|
-
opts[:oauth_callback] = callback_url
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
@access_token = request_token.get_access_token(opts)
|
|
64
|
-
super
|
|
65
|
-
rescue ::Timeout::Error => e
|
|
66
|
-
fail!(:timeout, e)
|
|
67
|
-
rescue ::Net::HTTPFatalError, ::OpenSSL::SSL::SSLError => e
|
|
68
|
-
fail!(:service_unavailable, e)
|
|
69
|
-
rescue ::Campus::Unauthorized => e
|
|
70
|
-
fail!(:invalid_credentials, e)
|
|
71
|
-
rescue ::MultiJson::DecodeError => e
|
|
72
|
-
fail!(:invalid_response, e)
|
|
73
|
-
rescue ::OmniAuth::NoSessionError => e
|
|
74
|
-
fail!(:session_expired, e)
|
|
30
|
+
info do
|
|
31
|
+
{
|
|
32
|
+
:name => raw_info['name'],
|
|
33
|
+
:email => raw_info['email']
|
|
34
|
+
}
|
|
75
35
|
end
|
|
76
36
|
|
|
77
|
-
|
|
78
|
-
{
|
|
37
|
+
extra do
|
|
38
|
+
{
|
|
39
|
+
'raw_info' => raw_info
|
|
40
|
+
}
|
|
79
41
|
end
|
|
80
42
|
|
|
81
|
-
|
|
82
|
-
|
|
43
|
+
def raw_info
|
|
44
|
+
@raw_info ||= access_token.get('/me').parsed
|
|
83
45
|
end
|
|
84
46
|
|
|
85
47
|
end
|
|
Binary file
|