omniauth-campus 3.5 → 3.6

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: 5baf7973c9029caac8b8e8fc3ca76872b1e5913f
4
- data.tar.gz: dc115ca8e264590fa56c61a85f982f74b98d0b1e
3
+ metadata.gz: f6b56a4db2f34d1942c266dae65587fb0917f771
4
+ data.tar.gz: 0b47057576b54653559852a1766e0be3e229ab92
5
5
  SHA512:
6
- metadata.gz: b3490915f414180e62981fa7ec6e1e38f5c9d6c7b4f45116306c1ff30cfa06fd1b9f8a4d660493bf772cb8e1263c318dec0cab0a149fc9fb7606af83d44d5cb6
7
- data.tar.gz: 677bf21c7bd30a778661562fb9a68db56a832c9c460b0449572727046bfa59e20fbbb764f9ddc188f1ef91fcccc9a988cd3b7efd6efeb2771db8f5217a42a7ee
6
+ metadata.gz: 5b7650c85f9caae15f28319acc4549072bad0b59fdbf22771b76a147a7d55fc9b39740fbbaddcb5280421b5fe75dd2705a8cfbdf2987c26c1c3a535b4c2c47da
7
+ data.tar.gz: 2574bc2dd0d445e5556e5af395abe6acfa5e0c658cc8e2cca9bb8618fbecc9fae142631a60529245ba6261a34f5dfb5b13ab6aa0453edfde58ba19e4d03889cf
@@ -1,6 +1,6 @@
1
1
  module Omniauth
2
2
  module Campus
3
- VERSION = "3.5"
3
+ VERSION = "3.6"
4
4
  end
5
5
  end
6
6
 
@@ -30,68 +30,17 @@ module OmniAuth
30
30
  #:proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil}
31
31
 
32
32
 
33
+ uid{access_token.params['uid']}
33
34
 
34
- def consumer
35
- consumer = ::OAuth::Consumer.new(options.consumer_key, options.consumer_secret, options.client_options)
36
- consumer.http.open_timeout = options.open_timeout if options.open_timeout
37
- consumer.http.read_timeout = options.read_timeout if options.read_timeout
38
- consumer
39
- end
40
-
41
- def request_phase
42
- request_token = consumer.get_request_token({:oauth_callback => callback_url}, options.request_params)
43
- session['oauth'] ||= {}
44
- session['oauth'][name.to_s] = {'callback_confirmed' => request_token.callback_confirmed?, 'request_token' => request_token.token, 'request_secret' => request_token.secret}
45
-
46
- if request_token.callback_confirmed?
47
- redirect request_token.authorize_url(options[:authorize_params])
48
- else
49
- redirect request_token.authorize_url(options[:authorize_params].merge(:oauth_callback => callback_url))
50
- end
51
-
52
- rescue ::Timeout::Error => e
53
- fail!(:timeout, e)
54
- rescue ::Net::HTTPFatalError, ::OpenSSL::SSL::SSLError => e
55
- fail!(:service_unavailable, e)
56
- end
57
-
58
- def callback_phase
59
- raise OmniAuth::NoSessionError.new("Session Expired") if session['oauth'].nil?
60
-
61
- request_token = ::OAuth::RequestToken.new(consumer, session['oauth'][name.to_s].delete('request_token'), session['oauth'][name.to_s].delete('request_secret'))
62
-
63
- opts = {}
64
- if session['oauth'][name.to_s]['callback_confirmed']
65
- opts[:oauth_verifier] = request['oauth_verifier']
66
- else
67
- opts[:oauth_callback] = callback_url
68
- end
69
-
70
- @access_token = request_token.get_access_token(opts)
71
- super
72
- rescue ::Timeout::Error => e
73
- fail!(:timeout, e)
74
- rescue ::Net::HTTPFatalError, ::OpenSSL::SSL::SSLError => e
75
- fail!(:service_unavailable, e)
76
- rescue ::OAuth::Unauthorized => e
77
- fail!(:invalid_credentials, e)
78
- rescue ::MultiJson::DecodeError => e
79
- fail!(:invalid_response, e)
80
- rescue ::OmniAuth::NoSessionError => e
81
- fail!(:session_expired, e)
82
- end
83
-
84
- uid {
85
- access_token.params['uid']
35
+ info do {
36
+ :email => access_token.params['email']
86
37
  }
38
+ end
87
39
 
88
- credentials do
89
- {'token' => access_token.token, 'secret' => access_token.secret}
90
- end
91
-
92
- extra do
93
- {'access_token' => access_token}
94
- end
40
+ extra do {
41
+ 'raw_info' => raw_info
42
+ }
43
+ end
95
44
 
96
45
  def raw_info
97
46
  @raw_info ||= MultiJson.decode(access_token.get('/users.json').body)
@@ -99,6 +48,11 @@ module OmniAuth
99
48
  raise ::Timeout::Error
100
49
  end
101
50
 
51
+ def request_phase
52
+ options[:authorize_params] = {:perms => options[:scope]} if options[:scope]
53
+ super
54
+ end
55
+
102
56
 
103
57
 
104
58
  #def auth_hash
@@ -108,7 +62,7 @@ module OmniAuth
108
62
  #end
109
63
 
110
64
 
111
- end
112
65
  end
113
66
  end
67
+ end
114
68
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-campus
3
3
  version: !ruby/object:Gem::Version
4
- version: '3.5'
4
+ version: '3.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnvehr