omniauth-opinionage 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -6,20 +6,26 @@ module OmniAuth
|
|
6
6
|
|
7
7
|
class Opinionage < OmniAuth::Strategies::OAuth2
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
def initialize(*args)
|
10
|
+
super
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
:token_url => "/auth/token",
|
15
|
-
:url => "https://opinionage.com", :ssl => { :verify => false } }
|
12
|
+
@OAUTH_BASE_URL = ENV['OAUTH_BASE_URL'] || "https://www.opinionage.com"
|
13
|
+
@SERVICES_BASE_URL = ENV['SERVICES_BASE_URL'] || "https://opinionage.com/api"
|
16
14
|
|
17
|
-
|
18
|
-
|
15
|
+
puts "OmniAuth::Opinionage OAUTH_BASE_URL=#{@OAUTH_BASE_URL} - SERVICES_BASE_URL=#{@SERVICES_BASE_URL}"
|
16
|
+
@options[:client_options] = { :site => @OAUTH_BASE_URL,
|
17
|
+
:authorize_url => "/auth/authorize",
|
18
|
+
:token_url => "/auth/token",
|
19
|
+
:url => @OAUTH_BASE_URL, :ssl => { :verify => false } }
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
@options[:mode] = :query
|
22
|
+
@options[:param_name] = 'access_token'
|
23
|
+
|
24
|
+
@options[:token_params] = {
|
25
|
+
:parse => :json
|
26
|
+
}
|
27
|
+
|
28
|
+
end
|
23
29
|
|
24
30
|
uid { raw_info['user']['graph_id'] }
|
25
31
|
|
@@ -35,7 +41,7 @@ module OmniAuth
|
|
35
41
|
end
|
36
42
|
|
37
43
|
def raw_info
|
38
|
-
@raw_info ||= access_token.get(SERVICES_BASE_URL + "/1/users/me").parsed || { }
|
44
|
+
@raw_info ||= access_token.get(@SERVICES_BASE_URL + "/1/users/me").parsed || { }
|
39
45
|
end
|
40
46
|
|
41
47
|
def build_access_token
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: omniauth-opinionage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Carlo Alberto Degli Atti
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-10-12 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: omniauth-oauth2
|