omniauth-fenix 0.1.8 → 0.1.9
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 +28 -9
- data/lib/omniauth-fenix/version.rb +1 -1
- data/omniauth-fenix-0.1.8.gem +0 -0
- metadata +2 -2
- data/omniauth-fenix-0.1.7.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7c0dfdf79931817867f85aa8fa1835db61fc33f
|
4
|
+
data.tar.gz: c75859319b456ee11efaf0333952f3129ea7ed3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0df246a86b521cfb9ba50f7b80f5da3cac7a6fe3e0c2748e750087fb61626cf40e4d2467f5ce58c7da4bfe2d182d12b9c315e08e650a830d4a3803e8d75c5a26
|
7
|
+
data.tar.gz: 36846cc1cb9ec73738b07b7afc8f4c1ccd354aed47a06dea29759155cf4ec76250a2306f9000c80f080d81d07f041318ab7c6f47f005fdb9a77f9370d036ecdb
|
@@ -5,6 +5,10 @@ module OmniAuth
|
|
5
5
|
class Fenix < OmniAuth::Strategies::OAuth2
|
6
6
|
option :name, 'fenix'
|
7
7
|
|
8
|
+
option :client_options, {
|
9
|
+
:token_url => 'https://fenix.tecnico.ulisboa.pt/oauth/access_token'
|
10
|
+
}
|
11
|
+
|
8
12
|
args [:api_key, :api_secret]
|
9
13
|
|
10
14
|
AUTHORIZE_URL = 'https://fenix.tecnico.ulisboa.pt/oauth/'
|
@@ -13,6 +17,30 @@ module OmniAuth
|
|
13
17
|
redirect request_url
|
14
18
|
end
|
15
19
|
|
20
|
+
def build_access_token
|
21
|
+
token_params = {
|
22
|
+
:client_id => client.id,
|
23
|
+
:client_secret => client.secret,
|
24
|
+
:redirect_uri => callback_url
|
25
|
+
}
|
26
|
+
|
27
|
+
log :info, ">>>>>>>> calling build_access_token"
|
28
|
+
verifier = request.params['code']
|
29
|
+
log :info, ">>>>>>> code: #{verifier.inspect}"
|
30
|
+
log :info, ">>>>> getting auth token now"
|
31
|
+
token = client.auth_code.get_token(verifier, token_params)
|
32
|
+
log :info, ">>>>>> token: #{token.inspect}"
|
33
|
+
token
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def request_url
|
39
|
+
"#{AUTHORIZE_URL}userdialog?client_id=#{options.api_key}&redirect_uri=#{callback_url}"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
16
44
|
# uid { raw_info["username"] }
|
17
45
|
#
|
18
46
|
# info do
|
@@ -26,12 +54,3 @@ module OmniAuth
|
|
26
54
|
# def raw_info
|
27
55
|
# @raw_info ||= access_token.get("/api/fenix/v1/person").parsed
|
28
56
|
# end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def request_url
|
33
|
-
"#{AUTHORIZE_URL}userdialog?client_id=#{options.api_key}&redirect_uri=#{callback_url}"
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-fenix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rui Mangas Pereira
|
@@ -71,7 +71,7 @@ files:
|
|
71
71
|
- lib/omniauth-fenix.rb
|
72
72
|
- lib/omniauth-fenix/version.rb
|
73
73
|
- lib/omniauth/strategies/fenix.rb
|
74
|
-
- omniauth-fenix-0.1.
|
74
|
+
- omniauth-fenix-0.1.8.gem
|
75
75
|
- omniauth-fenix.gemspec
|
76
76
|
homepage:
|
77
77
|
licenses:
|
data/omniauth-fenix-0.1.7.gem
DELETED
Binary file
|