saml2 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saml2/service_provider.rb +24 -0
- data/lib/saml2/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11ee4a47ccd8dbe5b2b78e2442b1d42af58a147913ab005d7ba242ce618bb416
|
4
|
+
data.tar.gz: 3a0ae077af118a78c88a8f677767e1e459ade7102e4e7d16f90362050ab389b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f98a1dc63f85c94325872d317ed633922f602e5f3ffed0716d46d84a1bbdf362b0700ac3db5139256ef7c405fc08ebfe2685f00152ade52a5a00a1823c68512b
|
7
|
+
data.tar.gz: e428c3aa1d3c43a0815c31eca74f354dfc72d27236e6a89dba1ce22cba5f2401a51b038c18bf05af48d029f616151921e969866fef71011d59baca7dfe489455
|
@@ -7,8 +7,12 @@ require 'saml2/sso'
|
|
7
7
|
|
8
8
|
module SAML2
|
9
9
|
class ServiceProvider < SSO
|
10
|
+
attr_writer :authn_requests_signed, :want_assertions_signed
|
11
|
+
|
10
12
|
def initialize
|
11
13
|
super
|
14
|
+
@authn_requests_signed = nil
|
15
|
+
@want_assertions_signed = nil
|
12
16
|
@assertion_consumer_services = Endpoint::Indexed::Array.new
|
13
17
|
@attribute_consuming_services = AttributeConsumingService::Array.new
|
14
18
|
end
|
@@ -20,6 +24,22 @@ module SAML2
|
|
20
24
|
@attribute_consuming_services = nil
|
21
25
|
end
|
22
26
|
|
27
|
+
# @return [Boolean, nil]
|
28
|
+
def authn_requests_signed?
|
29
|
+
unless instance_variable_defined?(:@authn_requests_signed)
|
30
|
+
@authn_requests_signed = xml['AuthnRequestsSigned'] && xml['AuthnRequestsSigned'] == 'true'
|
31
|
+
end
|
32
|
+
@authn_requests_signed
|
33
|
+
end
|
34
|
+
|
35
|
+
# @return [Boolean, nil]
|
36
|
+
def want_assertions_signed?
|
37
|
+
unless instance_variable_defined?(:@want_assertions_signed)
|
38
|
+
@want_assertions_signed = xml['WantAssertionsSigned'] && xml['WantAssertionsSigned'] == 'true'
|
39
|
+
end
|
40
|
+
@want_assertions_signed
|
41
|
+
end
|
42
|
+
|
23
43
|
# @return [Endpoint::Indexed::Array]
|
24
44
|
def assertion_consumer_services
|
25
45
|
@assertion_consumer_services ||= begin
|
@@ -41,6 +61,9 @@ module SAML2
|
|
41
61
|
builder['md'].SPSSODescriptor do |sp_sso_descriptor|
|
42
62
|
super(sp_sso_descriptor)
|
43
63
|
|
64
|
+
sp_sso_descriptor['AuthnRequestsSigned'] = authn_requests_signed? unless authn_requests_signed?.nil?
|
65
|
+
sp_sso_descriptor['WantAssertionsSigned'] = want_assertions_signed? unless authn_requests_signed?.nil?
|
66
|
+
|
44
67
|
assertion_consumer_services.each do |acs|
|
45
68
|
acs.build(sp_sso_descriptor, 'AssertionConsumerService')
|
46
69
|
end
|
@@ -52,3 +75,4 @@ module SAML2
|
|
52
75
|
end
|
53
76
|
end
|
54
77
|
end
|
78
|
+
|
data/lib/saml2/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saml2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|