omniauth-latvija 2.0.0 → 3.0.0
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/README.md +27 -0
- data/lib/omniauth-latvija/version.rb +1 -1
- data/lib/omniauth/strategies/latvija.rb +20 -12
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61e8e173bd8c5e154333778d5838d7c8d5d858dd
|
4
|
+
data.tar.gz: 698200a449f8c9047d87690e2221e36022a926c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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
|
68
|
-
|
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:
|
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:
|
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: '
|
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: '
|
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: '
|
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: '
|
82
|
+
version: '3.7'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: byebug
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|