omniauth-fenix 0.3.7 → 0.3.8
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/fenix.rb +7 -13
- data/lib/omniauth-fenix/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: e84aa0609d614d2d5d29ae159927a8d793040642
|
4
|
+
data.tar.gz: 3f03201f5ac2428ce2c2f3a4ed4e1b7b36c28306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7caf548960dbb65476928d1661b4c08b7b71be3490f84eb1b07cfb743839c560b77bebff5c05be6d6864abf23d58c218df74f2e5ec3061a2040cf445f45fc38b
|
7
|
+
data.tar.gz: d663c3a3577f334578427c758268657fc57958bf7540a2b5a50c693a031cf8cfb35d2cb82e66e1fb69bde53285cd35be2d3eaf8a1f40935b11bca6a2621566a0
|
@@ -11,9 +11,6 @@ module OmniAuth
|
|
11
11
|
:authorize_url => 'https://fenix.tecnico.ulisboa.pt/oauth/'
|
12
12
|
}
|
13
13
|
|
14
|
-
AUTHORIZE_URL = 'https://fenix.tecnico.ulisboa.pt/oauth/'
|
15
|
-
CALLBACK_URL = 'http://192.168.99.100:3000/auth/fenix/callback'
|
16
|
-
|
17
14
|
def request_phase
|
18
15
|
redirect request_url
|
19
16
|
end
|
@@ -31,20 +28,16 @@ module OmniAuth
|
|
31
28
|
|
32
29
|
def raw_info
|
33
30
|
access_token.options[:parse] = :json
|
34
|
-
url = "https://fenix.tecnico.ulisboa.pt/api/fenix/
|
31
|
+
url = "https://fenix.tecnico.ulisboa.pt/api/fenix/v2/person"
|
35
32
|
params = { :params => { :access_token => access_token.token } }
|
36
33
|
@raw_info ||= access_token.get(url, params).parsed
|
37
34
|
end
|
38
35
|
|
39
36
|
def build_access_token
|
40
|
-
puts "JOAO"
|
41
|
-
puts callback_url
|
42
|
-
puts "JOAO"
|
43
|
-
|
44
37
|
token_params = {
|
45
38
|
:client_id => client.id,
|
46
39
|
:client_secret => client.secret,
|
47
|
-
:redirect_uri =>
|
40
|
+
:redirect_uri => callback_url
|
48
41
|
:code => request.params['code'],
|
49
42
|
:grant_type => 'authorization_code'
|
50
43
|
}
|
@@ -52,13 +45,14 @@ module OmniAuth
|
|
52
45
|
client.get_token(token_params)
|
53
46
|
end
|
54
47
|
|
48
|
+
def callback_url
|
49
|
+
callback_url.split("?").first
|
50
|
+
end
|
51
|
+
|
55
52
|
private
|
56
53
|
|
57
54
|
def request_url
|
58
|
-
|
59
|
-
puts callback_url
|
60
|
-
puts "OLA"
|
61
|
-
"#{AUTHORIZE_URL}userdialog?client_id=#{client.id}&redirect_uri=#{callback_url}"
|
55
|
+
"#{options.client_options.fetch(:authorize_url)}userdialog?client_id=#{client.id}&redirect_uri=#{callback_url}"
|
62
56
|
end
|
63
57
|
end
|
64
58
|
end
|