omniauth-surveymonkey2 0.0.5 → 0.0.6
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 +4 -4
- data/lib/omniauth/strategies/surverymonkey2.rb +0 -42
- data/lib/omniauth/surveymonkey2/version.rb +1 -1
- 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: 5ff45202d24adde4f7d46c4e1c8fa76176faf0f5
|
4
|
+
data.tar.gz: adbc23c3f556f8351044816bef80b0fb8783e294
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac6418e72501b3f06d989829bffc6109486b8edc1f6ab199747ad27de896af361de04d3ee8806614c6365717c2d711dc8442f07c4b1c291d7251bfc621eb5d4f
|
7
|
+
data.tar.gz: ccbf457ee06d2c5fdb98aa25c5e7cf68f961c26168ca5feb289b692c7a030d37a67dd8e34143cbecd3a9f282a3a2863441fb23c868dfd3125e44dc12702de796
|
@@ -9,49 +9,7 @@ module OmniAuth
|
|
9
9
|
|
10
10
|
option :name, "surveymonkey"
|
11
11
|
|
12
|
-
option :client_options, {
|
13
|
-
:site => "https://api-surveymonkey-com-fytofsd4ktc2.runscope.net",
|
14
|
-
:authorize_url => '/oauth/authorize',
|
15
|
-
:token_url => '/oauth/token'
|
16
|
-
}
|
17
|
-
|
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
|
41
12
|
|
42
|
-
def callback_phase
|
43
|
-
options[:client_options][:token_url] = "/oauth/token?api_key=#{options[:api_key]}"
|
44
|
-
self.access_token = build_access_token
|
45
|
-
self.env['omniauth.auth'] = auth_hash
|
46
|
-
call_app!
|
47
|
-
end
|
48
|
-
|
49
|
-
info do
|
50
|
-
{
|
51
|
-
:token => self.access_token.token,
|
52
|
-
:client => self.access_token.client.id
|
53
|
-
}
|
54
|
-
end
|
55
13
|
end
|
56
14
|
end
|
57
15
|
end
|