Class: SAML2::IdentityProvider
- Inherits:
-
SSO
show all
- Defined in:
- lib/saml2/identity_provider.rb
Instance Attribute Summary collapse
Attributes inherited from SSO
#name_id_formats, #single_logout_services
Attributes inherited from Role
#keys, #supported_protocols
#contacts, #organization
Instance Method Summary
collapse
Methods inherited from Role
#encryption_keys, #signing_keys
Methods inherited from Base
from_xml, #from_xml, load_object_array, load_string_array, #to_s, #to_xml
Constructor Details
8
9
10
11
12
13
14
15
16
|
# File 'lib/saml2/identity_provider.rb', line 8
def initialize(node = nil)
super(node)
unless node
@want_authn_requests_signed = nil
@single_sign_on_services = []
@attribute_profiles = []
@attributes = []
end
end
|
Instance Attribute Details
#attribute_profiles ⇒ Object
29
30
31
|
# File 'lib/saml2/identity_provider.rb', line 29
def attribute_profiles
@attribute_profiles ||= load_string_array(@root, 'md:AttributeProfile')
end
|
#attributes ⇒ Object
33
34
35
|
# File 'lib/saml2/identity_provider.rb', line 33
def attributes
@attributes ||= load_object_array(@root, 'saml:Attribute', Attribute)
end
|
#single_sign_on_services ⇒ Object
25
26
27
|
# File 'lib/saml2/identity_provider.rb', line 25
def single_sign_on_services
@single_sign_on_services ||= load_object_array(@root, 'md:SingleSignOnService', Endpoint)
end
|
#want_authn_requests_signed=(value) ⇒ Object
Sets the attribute want_authn_requests_signed
6
7
8
|
# File 'lib/saml2/identity_provider.rb', line 6
def want_authn_requests_signed=(value)
@want_authn_requests_signed = value
end
|
Instance Method Details
#build(builder) ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/saml2/identity_provider.rb', line 37
def build(builder)
builder['md'].IDPSSODescriptor do |builder|
super(builder)
builder['WantAuthnRequestsSigned'] = want_authn_requests_signed? unless want_authn_requests_signed?.nil?
single_sign_on_services.each do |sso|
sso.build(builder, 'SingleSignOnService')
end
attribute_profiles.each do |ap|
builder['md'].AttributeProfile(ap)
end
attributes.each do |attr|
attr.build(builder)
end
end
end
|
#want_authn_requests_signed? ⇒ Boolean
18
19
20
21
22
23
|
# File 'lib/saml2/identity_provider.rb', line 18
def want_authn_requests_signed?
unless instance_variable_defined?(:@want_authn_requests_signed)
@want_authn_requests_signed = @root['WantAuthnRequestsSigned'] && @root['WantAuthnRequestsSigned'] == 'true'
end
@want_authn_requests_signed
end
|