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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 579e772e73c224b345968a4e2cb34b8487dc4eed
4
- data.tar.gz: 4b6264236aaf6d81d98c49cd053e7eae6698be53
3
+ metadata.gz: e7c0dfdf79931817867f85aa8fa1835db61fc33f
4
+ data.tar.gz: c75859319b456ee11efaf0333952f3129ea7ed3f
5
5
  SHA512:
6
- metadata.gz: 0aeb91c3b355fbaec75ca30f5a07cf6842be8b96895956e2ba69ca625fc8b3bb49678678d46a7d3ad48ff04603b62ab369fa0068711a4f285b642637804c8116
7
- data.tar.gz: 4cd38d6e4eff0b0ae690f48262a0721ccdaf7ee361c2860e07c0c2f9c8d15e685607231e65be84da202515e810a345e6acd51ada2b7b2dd05db945fa49de3cf3
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
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Fenix
3
- VERSION = "0.1.8"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  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.8
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.7.gem
74
+ - omniauth-fenix-0.1.8.gem
75
75
  - omniauth-fenix.gemspec
76
76
  homepage:
77
77
  licenses:
Binary file