omniauth-suomifi 0.4.1 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/omniauth/strategies/suomifi.rb +18 -8
- data/lib/omniauth-suomifi/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3343cb094200e73b259c021ebcd80e7d4c21ecc1cccc5706b9aa55dc7d214dc6
|
4
|
+
data.tar.gz: 032c0abbb7fc157a988890d639dfe8ba1c476cb9446f3a20e6eba6e83f77e5e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f671513e0c41c72ce3e09d6b643685b6298347a9637f7ca9bf0bf09432d9a53e5dc429ab1877b322b5fad956fc56ed97969e9a211c032f0e338c3970a7bde31b
|
7
|
+
data.tar.gz: a1cc1add8a88f4ccf43761a621f43cc9e83b20683e64403eef171159a106e99151b55d4b97b5cf76fe0f617b4c007cab64e15661c820d60de0ecd71404619aef
|
@@ -28,16 +28,16 @@ module OmniAuth
|
|
28
28
|
# - en_US
|
29
29
|
#
|
30
30
|
# In case a valid language cannot be parsed from the parameter, the locale
|
31
|
-
# parameter will default to `:
|
31
|
+
# parameter will default to `:idp_sso_service_url_default_locale`.
|
32
32
|
#
|
33
33
|
# Note that the locale parameter is always added as the last parameter in
|
34
34
|
# in the redirect URL as expected by Suomi.fi.
|
35
|
-
option :
|
35
|
+
option :idp_sso_service_url_locale_params, %w[locale language lang]
|
36
36
|
|
37
37
|
# This is the default locale to be passed to IdP sign in redirect URL as
|
38
38
|
# defined above. In case a valid locale is not found from the request
|
39
39
|
# parameters, this will be used instead.
|
40
|
-
option :
|
40
|
+
option :idp_sso_service_url_default_locale, 'fi'
|
41
41
|
|
42
42
|
# The request attributes for Suomi.fi
|
43
43
|
option :possible_request_attributes, [
|
@@ -557,7 +557,7 @@ module OmniAuth
|
|
557
557
|
# Suomi.fi requires that the service provider needs to end the local user
|
558
558
|
# session BEFORE sending the logout request to the identity provider.
|
559
559
|
def other_phase_for_spslo
|
560
|
-
return super unless options.
|
560
|
+
return super unless options.idp_slo_service_url
|
561
561
|
|
562
562
|
with_settings do |settings|
|
563
563
|
# Some session variables are needed when generating the logout request
|
@@ -610,7 +610,7 @@ module OmniAuth
|
|
610
610
|
when :test
|
611
611
|
'https://testi.apro.tunnistus.fi/static/metadata/idp-metadata.xml'
|
612
612
|
else # :production
|
613
|
-
'https://tunnistus.suomi.fi/static/metadata/idp-metadata
|
613
|
+
'https://tunnistus.suomi.fi/static/metadata/idp-metadata.xml'
|
614
614
|
end
|
615
615
|
end
|
616
616
|
|
@@ -629,6 +629,16 @@ module OmniAuth
|
|
629
629
|
slo_binding: ['urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect']
|
630
630
|
)
|
631
631
|
|
632
|
+
if settings[:idp_slo_response_service_url].nil? && settings[:idp_slo_target_url].nil?
|
633
|
+
# Mitigation after ruby-saml update to 1.12.x. This gem has been
|
634
|
+
# originally developed relying on the `:idp_slo_target_url` settings
|
635
|
+
# which was removed from the newer versions. The SLO requests won't
|
636
|
+
# work unless `:idp_slo_response_service_url` is defined in the
|
637
|
+
# metadata through the `ResponseLocation` attribute in the
|
638
|
+
# `<SingleLogoutService />` node.
|
639
|
+
settings[:idp_slo_target_url] ||= settings[:idp_slo_service_url]
|
640
|
+
end
|
641
|
+
|
632
642
|
# Local certificate and private key to decrypt the responses
|
633
643
|
settings[:certificate] = certificate
|
634
644
|
settings[:private_key] = private_key
|
@@ -662,8 +672,8 @@ module OmniAuth
|
|
662
672
|
end
|
663
673
|
|
664
674
|
def locale_for_authn_request
|
665
|
-
if options.
|
666
|
-
options.
|
675
|
+
if options.idp_sso_service_url_locale_params.is_a?(Array)
|
676
|
+
options.idp_sso_service_url_locale_params.each do |param|
|
667
677
|
next unless request.params.key?(param.to_s)
|
668
678
|
|
669
679
|
locale = parse_language_value(request.params[param.to_s])
|
@@ -671,7 +681,7 @@ module OmniAuth
|
|
671
681
|
end
|
672
682
|
end
|
673
683
|
|
674
|
-
options.
|
684
|
+
options.idp_sso_service_url_default_locale
|
675
685
|
end
|
676
686
|
|
677
687
|
def parse_language_value(string)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-suomifi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antti Hukkanen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-saml
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.10.3
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ruby-saml
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.12.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.12.1
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|