omniauth-surveymonkey2 0.0.7 → 0.0.8

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: 428d16f757dade79c13171d9972cf0fefb6093d0
4
- data.tar.gz: fa0c053e1e575170b9be5f3fa1e7ba3da1e324b5
3
+ metadata.gz: a303a3404a924528d1cf486caea2498f132b489b
4
+ data.tar.gz: d306e16159e590078b5cb9904ef41a46648938ea
5
5
  SHA512:
6
- metadata.gz: b26d54645a99c9877354af0fc7a8395654fcf344954be842b508436c1f3289a5c9f191e74d72dde26d372f6e17062a23143d48583114e1ff713a297cf65fde50
7
- data.tar.gz: 006e53aa1b4f820fb1c60f8d12cea5c1f1df2acd9ceaedf81c41313cc12e4469fdcdd14256977033e9953610007b0e50c54ec8be4327243fdfb239ea2c711899
6
+ metadata.gz: 0e5a182f018d5ee61e6b9654e03c6a9cc28715e6d80f9baa3fa420b1954ae89d9f154e2448f0c040b4cc5c49fee49041cffb6f308a31f7043f51a38749ddd9dd
7
+ data.tar.gz: 33258013fbba836f33b98114f4cdf50a58bd5566fd840f414114702db4a8d4c6125c9fd5f0d6eac33b0fa0769b0f020e53beb69e11717e9d32ba8670060b1851
@@ -5,68 +5,21 @@ module OmniAuth
5
5
  class Surveymonkey < OmniAuth::Strategies::OAuth2
6
6
 
7
7
 
8
- DEFAULT_RESPONSE_TYPE = 'code'
9
- DEFAULT_GRANT = 'authorization_code'
10
-
11
8
  option :name, "surveymonkey"
12
9
 
13
10
  option :client_options, {
14
- :site => "https://api-surveymonkey-com-fytofsd4ktc2.runscope.net",
11
+ :site => "https://api.surveymonkey.com",
15
12
  :authorize_url => '/oauth/authorize',
16
13
  :token_url => '/oauth/token'
17
14
  }
18
15
 
19
- option :authorize_options, [:client_id, :api_key]
20
-
21
- def authorize_params
22
- log :info, ">>>>>>>> in authorize_params"
23
- super.tap do |params|
24
- params[:response_type] ||= DEFAULT_RESPONSE_TYPE
25
- params[:client_id] = options[:client_id]
26
- params[:api_key] = options[:api_key]
27
- end
28
- end
29
-
30
- def token_params
31
- log :info, ">>>>>>> calling token params"
32
- super.tap do |params|
33
- params[:grant_type] ||= DEFAULT_GRANT
34
- params[:client_id] = options[:client_id]
35
- params[:client_secret] = options[:client_secret]
36
- params[:redirect_uri] = callback_url
37
- end
38
- end
39
-
40
- def build_access_token
41
- log :info, ">>>>>>>> calling build_access_token"
42
- verifier = request.params['code']
43
- log :info, ">>>>>>> code: #{verifier.inspect}"
44
- log :info, ">>>>> getting auth token now"
45
- token = client.auth_code.get_token(verifier, token_params)
46
- log :info, ">>>>>> token: #{token.inspect}"
47
- token
48
- end
16
+ option :authorize_options, [:api_key]
49
17
 
50
18
  def callback_phase
51
- log :info, ">>>>>>>> in callback_phase"
52
19
  options[:client_options][:token_url] = "/oauth/token?api_key=#{options[:api_key]}"
53
- log :info, ">>>> in callback phase, calling build_access_token"
54
- self.access_token = build_access_token
55
- log :info, ">>>>>> self access token: #{self.access_token.inspect}"
56
- log :info, ">>>> getting ready to set auth hash"
57
- hash = auth_hash
58
- log :info, ">>>>> auth hash is: #{hash.inspect}"
59
- self.env['omniauth.auth'] = hash
60
- log :info, ">>>> calling app"
61
- call_app!
20
+ super
62
21
  end
63
22
 
64
- info do
65
- {
66
- :token => self.access_token.token,
67
- :client => self.access_token.client.id
68
- }
69
- end
70
23
 
71
24
  end
72
25
  end
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Surveymonkey
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-surveymonkey2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaushik SV
@@ -86,6 +86,7 @@ files:
86
86
  - lib/omniauth/surveymonkey/version.rb
87
87
  - omniauth-surveymonkey.gemspec
88
88
  - omniauth-surveymonkey.rb
89
+ - omniauth-surveymonkey2-0.0.7.gem
89
90
  - spec/omniauth/strategies/surveymonkey_spec.rb
90
91
  homepage: https://github.com/cbeck/omniauth-surveymonkey
91
92
  licenses: []