omniauth-latvija 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 875159da4f23d72890c3da6c24f1b174d197f6ec
4
- data.tar.gz: af5a474b33c9165faf67a14a61b8785e0567a456
3
+ metadata.gz: 61e8e173bd8c5e154333778d5838d7c8d5d858dd
4
+ data.tar.gz: 698200a449f8c9047d87690e2221e36022a926c7
5
5
  SHA512:
6
- metadata.gz: 36fc98917bfe2547d020287fc90f6c4dcc986722c903be7acf49a3ffe56d7899d097661a0620352bb95646cfbc6db250cf911b89b2bbf603db1e3cc5125defed
7
- data.tar.gz: 1f5947b59168bf23f22ab34c7b4b5ec83c2e01f4402a7035400bd885d00a3751d6eebffa741902f2c149a5d730b1f9ffb038f84015f40b6c514fe624290fe862
6
+ metadata.gz: 2f90ced3cba761f56ce57a2d24ecc684cb69e451008d72fa78d659b5496f995a566f368200ad1c67dd673f6efaefba196b29a29d6146231223d34c8b55fb8a2f
7
+ data.tar.gz: a9dafe2e3b298c9593e23918de155ebc8d6150583812744582e85c992a29b69aaa6bd21f91d66ccf3f397c0e19dc289c31eef921624392da281f8096b461911d
data/README.md CHANGED
@@ -39,6 +39,33 @@ Rails.application.config.middleware.use OmniAuth::Builder do
39
39
  end
40
40
  ```
41
41
 
42
+
43
+ ## Auth Hash
44
+
45
+ Here's an example hash available in `request.env['omniauth.auth']`
46
+
47
+ ```ruby
48
+ {
49
+ provider: 'latvija',
50
+ uid: 'JANIS BERZINS, 12345612345',
51
+ info: {
52
+ name: 'JANIS BERZINS',
53
+ first_name: 'JANIS',
54
+ last_name: 'BERZINS',
55
+ private_personal_identifier: '12345612345'
56
+ },
57
+ extra: {
58
+ raw_info: {
59
+ name: 'JANIS BERZINS',
60
+ first_name: 'JANIS',
61
+ last_name: 'BERZINS',
62
+ private_personal_identifier: '12345612345'
63
+ },
64
+ authentication_method: 'SWEDBANK'
65
+ }
66
+ }
67
+ ```
68
+
42
69
  ## References
43
70
 
44
71
  * http://docs.oasis-open.org/wsfed/federation/v1.2/os/ws-federation-1.2-spec-os.html
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Latvija
3
- VERSION = '2.0.0'
3
+ VERSION = '3.0.0'
4
4
  end
5
5
  end
@@ -34,6 +34,24 @@ module OmniAuth::Strategies
34
34
  option :certificate, nil
35
35
  option :private_key, nil
36
36
 
37
+ uid { "#{raw_info['givenname']} #{raw_info['surname']}, #{raw_info["privatepersonalidentifier"]}" }
38
+
39
+ info do
40
+ {
41
+ name: "#{raw_info['givenname']} #{raw_info['surname']}",
42
+ first_name: raw_info['givenname'],
43
+ last_name: raw_info['surname'],
44
+ private_personal_identifier: raw_info['privatepersonalidentifier']
45
+ }
46
+ end
47
+
48
+ extra do
49
+ {
50
+ raw_info: raw_info,
51
+ authentication_method: @response.authentication_method
52
+ }
53
+ end
54
+
37
55
  def request_phase
38
56
  params = {
39
57
  wa: 'wsignin1.0',
@@ -64,18 +82,8 @@ module OmniAuth::Strategies
64
82
  fail!(:invalid_response, e)
65
83
  end
66
84
 
67
- def auth_hash
68
- OmniAuth::Utils.deep_merge(super,
69
- uid: "#{@response.attributes['givenname']} #{@response.attributes['surname']}, #{@response.attributes["privatepersonalidentifier"]}",
70
- user_info: {
71
- name: "#{@response.attributes['givenname']} #{@response.attributes['surname']}",
72
- first_name: @response.attributes['givenname'],
73
- last_name: @response.attributes['surname'],
74
- private_personal_identifier: @response.attributes['privatepersonalidentifier']
75
- },
76
- authentication_method: @response.authentication_method,
77
- extra: @response.attributes
78
- )
85
+ def raw_info
86
+ @response.attributes
79
87
  end
80
88
  end
81
89
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-latvija
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgars Beigarts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-23 00:00:00.000000000 Z
11
+ date: 2018-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -56,30 +56,30 @@ dependencies:
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '12.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '12.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '2.10'
75
+ version: '3.7'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '2.10'
82
+ version: '3.7'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: byebug
85
85
  requirement: !ruby/object:Gem::Requirement