omniauth-campus 1.3 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth-campus/version.rb +1 -1
- data/lib/omniauth/strategies/campus.rb +22 -2
- 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: 3c16d37434b9fe9e988bc915ecdcf8937926026c
|
4
|
+
data.tar.gz: 2f33553fcad05d329a81d6fd82adb156ffb479c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93902abf2bf2375ed66de1e79d6d9b050cea1b11232f6d18d0d056b7c557cc4d4a4a99c38a51a8e0f58f352339c6541fc75ebd0e8c0562899ec7ae8603da062c
|
7
|
+
data.tar.gz: 67a15df8815a6e56cad25f7ce6d122383cfebc072130e25e703e30b1c5d288892b52bc48c980c035dc8e471d1ef0bed5de21485a8f75d327d3bd8133f40f61fb
|
@@ -22,11 +22,31 @@ module OmniAuth
|
|
22
22
|
#:site => 'http://dev-oauth-test.gotpantheon.com/myawesomejson',
|
23
23
|
#:proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil}
|
24
24
|
|
25
|
+
def consumer
|
26
|
+
consumer = ::OAuth::Consumer.new(options.consumer_key, options.consumer_secret, options.client_options)
|
27
|
+
consumer.http.open_timeout = options.open_timeout if options.open_timeout
|
28
|
+
consumer.http.read_timeout = options.read_timeout if options.read_timeout
|
29
|
+
consumer
|
30
|
+
end
|
31
|
+
|
25
32
|
def request_phase
|
26
|
-
|
27
|
-
|
33
|
+
request_token = consumer.get_request_token({:oauth_callback => callback_url}, options.request_params)
|
34
|
+
session['oauth'] ||= {}
|
35
|
+
session['oauth'][name.to_s] = {'callback_confirmed' => request_token.callback_confirmed?, 'request_token' => request_token.token, 'request_secret' => request_token.secret}
|
36
|
+
|
37
|
+
if request_token.callback_confirmed?
|
38
|
+
redirect request_token.authorize_url(options[:authorize_params])
|
39
|
+
else
|
40
|
+
redirect request_token.authorize_url(options[:authorize_params].merge(:oauth_callback => callback_url))
|
41
|
+
end
|
42
|
+
|
43
|
+
rescue ::Timeout::Error => e
|
44
|
+
fail!(:timeout, e)
|
45
|
+
rescue ::Net::HTTPFatalError, ::OpenSSL::SSL::SSLError => e
|
46
|
+
fail!(:service_unavailable, e)
|
28
47
|
end
|
29
48
|
|
49
|
+
|
30
50
|
uid{ request.params['user_id'] }
|
31
51
|
|
32
52
|
info do
|