omniauth-surveymonkey2 0.0.10 → 0.0.11
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: 6e39c53c87c6e2d51994afa5aeb529d76fbc259a
|
4
|
+
data.tar.gz: 2ae8071f0eaf87ad4cbab4fcf51324041553df8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc5ff1defd161d2c8515e7fde66cf992bb98e434c3722ff1b34ce5625d3365585d7b7328bd77fd5476ceda27b9bab49a384750aa21d393c70e2b744121f248dc
|
7
|
+
data.tar.gz: f3cb0d987a418da94ea052500adc5d433fd5ff00a32912d7f3b8806031602d1732ee3f0813c8ee76beaf5d3ad6e4b9592c3733e942acc3be13a70e2c81a7ff5d
|
@@ -4,21 +4,54 @@ module OmniAuth
|
|
4
4
|
module Strategies
|
5
5
|
class Surveymonkey2 < OmniAuth::Strategies::OAuth2
|
6
6
|
|
7
|
+
DEFAULT_RESPONSE_TYPE = 'code'
|
8
|
+
DEFAULT_GRANT = 'authorization_code'
|
9
|
+
|
7
10
|
option :name, "surveymonkey2"
|
8
11
|
|
9
12
|
option :client_options, {
|
10
|
-
:site => "https://api
|
13
|
+
:site => "https://api-surveymonkey-com-fytofsd4ktc2.runscope.net",
|
11
14
|
:authorize_url => '/oauth/authorize',
|
12
15
|
:token_url => '/oauth/token'
|
13
16
|
}
|
14
17
|
|
15
|
-
option :authorize_options, [:api_key]
|
18
|
+
option :authorize_options, [:client_id, :api_key]
|
19
|
+
|
20
|
+
def authorize_params
|
21
|
+
super.tap do |params|
|
22
|
+
params[:response_type] ||= DEFAULT_RESPONSE_TYPE
|
23
|
+
params[:client_id] = options[:client_id]
|
24
|
+
params[:api_key] = options[:api_key]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def token_params
|
29
|
+
super.tap do |params|
|
30
|
+
params[:grant_type] ||= DEFAULT_GRANT
|
31
|
+
params[:client_id] = options[:client_id]
|
32
|
+
params[:client_secret] = options[:client_secret]
|
33
|
+
params[:redirect_uri] = callback_url
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def build_access_token
|
38
|
+
verifier = request.params['code']
|
39
|
+
token = client.auth_code.get_token(verifier, token_params)
|
40
|
+
end
|
16
41
|
|
17
42
|
def callback_phase
|
18
43
|
options[:client_options][:token_url] = "/oauth/token?api_key=#{options[:api_key]}"
|
19
|
-
|
44
|
+
self.access_token = build_access_token
|
45
|
+
self.env['omniauth.auth'] = auth_hash
|
46
|
+
call_app!
|
20
47
|
end
|
21
48
|
|
49
|
+
info do
|
50
|
+
{
|
51
|
+
:token => self.access_token.token,
|
52
|
+
:client => self.access_token.client.id
|
53
|
+
}
|
54
|
+
end
|
22
55
|
end
|
23
56
|
end
|
24
57
|
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.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beck
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- lib/omniauth/strategies/surveymonkey2.rb
|
83
83
|
- lib/omniauth/surveymonkey2.rb
|
84
84
|
- lib/omniauth/surveymonkey2/version.rb
|
85
|
+
- omniauth-surveymonkey2-0.0.10.gem
|
85
86
|
- omniauth-surveymonkey2-0.0.9.gem
|
86
87
|
- omniauth-surveymonkey2.gemspec
|
87
88
|
- omniauth-surveymonkey2.rb
|