Class: SAML2::ServiceProvider

Inherits:
SSO show all
Defined in:
lib/saml2/service_provider.rb

Instance Attribute Summary

Attributes inherited from Role

#keys, #supported_protocols

Attributes included from OrganizationAndContacts

#contacts, #organization

Attributes inherited from Base

#xml

Instance Method Summary collapse

Methods inherited from SSO

#name_id_formats, #single_logout_services

Methods inherited from Role

#encryption_keys, #signing_keys

Methods inherited from Base

from_xml, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml

Constructor Details

#initializeServiceProvider

Returns a new instance of ServiceProvider.



8
9
10
11
12
# File 'lib/saml2/service_provider.rb', line 8

def initialize
  super
  @assertion_consumer_services = Endpoint::Indexed::Array.new
  @attribute_consuming_services = AttributeConsumingService::Array.new
end

Instance Method Details

#assertion_consumer_servicesObject



20
21
22
23
24
25
# File 'lib/saml2/service_provider.rb', line 20

def assertion_consumer_services
  @assertion_consumer_services ||= begin
    nodes = xml.xpath('md:AssertionConsumerService', Namespaces::ALL)
    Endpoint::Indexed::Array.from_xml(nodes)
  end
end

#attribute_consuming_servicesObject



27
28
29
30
31
32
# File 'lib/saml2/service_provider.rb', line 27

def attribute_consuming_services
  @attribute_consuming_services ||= begin
    nodes = xml.xpath('md:AttributeConsumingService', Namespaces::ALL)
    AttributeConsumingService::Array.from_xml(nodes)
  end
end

#build(builder) ⇒ Object



34
35
36
37
38
39
40
41
42
# File 'lib/saml2/service_provider.rb', line 34

def build(builder)
  builder['md'].SPSSODescriptor do |sp_sso_descriptor|
    super(sp_sso_descriptor)

    assertion_consumer_services.each do |acs|
      acs.build(sp_sso_descriptor, 'AssertionConsumerService')
    end
  end
end

#from_xml(node) ⇒ Object



14
15
16
17
18
# File 'lib/saml2/service_provider.rb', line 14

def from_xml(node)
  super
  @assertion_consumer_services = nil
  @attribute_consuming_services = nil
end