omniauth-dataporten 0.0.2 → 0.0.3

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: a03ac619c83e6ff92b4b14c67ac6f753a3e8ae5a
4
- data.tar.gz: dc652279a8913e854a88c4492f47a16859b6d5d1
3
+ metadata.gz: 5436c83fdcb9a36ca03294e9b783590ec9add317
4
+ data.tar.gz: 593708760bc52e5c71c4837b9cf9a67bf33d735c
5
5
  SHA512:
6
- metadata.gz: 6ab097216bda4a63c0942b6b7ea2f99333acbd887d57d9046a3f04bf6cecaf57bc2d9274e156f0d0facf3a5f38422dcec571d4141c9d1cdc546dc3e9c69c952d
7
- data.tar.gz: b9fb06c3b56dc05e7f7def4c486ea3f4526c014e46c67409360d7e29190ce7a7b8bf14610636d2ef936f3437702d9ec966845a043760be43d29d21c7ad3c2ba6
6
+ metadata.gz: 39efe818d3e962f0060485a8e217bced26c565908f1518180156729883311f0b1a433be4a0def49972386fe675b05d3da2af4cc046e274f193086bb9076f83cf
7
+ data.tar.gz: 1abb696c0e32dc2f8f8ae57900f66db5e7e7eaa5fada07c61663363a4caaa9dc340df653af5ae3353f1694903cdf4cf03c09c9e0efa90dc4a5b5760a0eec08c1
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Dataporten
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
@@ -1,47 +1,47 @@
1
1
  require 'omniauth-oauth2'
2
2
 
3
3
  module OmniAuth
4
- module Strategies
5
- class Dataporten < OmniAuth::Strategies::OAuth2
6
- option :name, "dataporten"
7
-
8
- option :client_options, {
9
- site: "https://auth.dataporten.no",
10
- authorize_url: "/ouath/authorization",
11
- token_url: "/oauth/token"
12
- }
13
-
14
- option :redirect_url
15
-
16
- uid { raw_info['user']['userid'] }
17
-
18
- info do
19
- {
20
- name: raw_info['user']['name'],
21
- username: raw_info['user']['userid'],
22
- email: raw_info['user']['email'],
23
- image: raw_info['user']['profilepicture']
24
- }
25
- end
26
-
27
- extra do
28
- { raw_info: raw_info }
29
- end
30
-
31
- def raw_info
32
- @raw_info ||= access_token.get('/userinfo').parsed
33
- end
34
-
35
- private
36
-
37
- def callback_url
38
- options.redirect_url || (full_host + script_name + callback_path)
39
- end
40
-
41
- def request_phase
42
- options[:response_type] ||= 'code'
43
- end
44
- end
45
- end
4
+ module Strategies
5
+ class Dataporten < OmniAuth::Strategies::OAuth2
6
+ option :name, "dataporten"
7
+
8
+ option :client_options, {
9
+ site: "https://auth.dataporten.no",
10
+ authorize_url: "/oauth/authorization",
11
+ token_url: "/oauth/token"
12
+ }
13
+
14
+ option :redirect_url
15
+
16
+ uid { raw_info['user']['userid'] }
17
+
18
+ info do
19
+ {
20
+ name: raw_info['user']['name'],
21
+ username: raw_info['user']['userid'],
22
+ email: raw_info['user']['email'],
23
+ image: raw_info['user']['profilepicture']
24
+ }
25
+ end
26
+
27
+ extra do
28
+ { raw_info: raw_info }
29
+ end
30
+
31
+ def raw_info
32
+ @raw_info ||= access_token.get('/userinfo').parsed
33
+ end
34
+
35
+ private
36
+
37
+ def callback_url
38
+ full_host + script_name + callback_path
39
+ end
40
+
41
+ #def request_phase
42
+ # options[:response_type] ||= 'code'
43
+ # super
44
+ #end
45
+ end
46
+ end
46
47
  end
47
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-dataporten
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - kasperrt