Class: SAML2::IdentityProvider
- Defined in:
- lib/saml2/identity_provider.rb
Instance Attribute Summary collapse
- #attribute_profiles ⇒ Object
- #attributes ⇒ Object
- #single_sign_on_services ⇒ Object
-
#want_authn_requests_signed ⇒ Object
writeonly
Sets the attribute want_authn_requests_signed.
Attributes inherited from Role
Attributes included from OrganizationAndContacts
Attributes inherited from Base
Instance Method Summary collapse
- #build(builder) ⇒ Object
- #from_xml(node) ⇒ Object
-
#initialize ⇒ IdentityProvider
constructor
A new instance of IdentityProvider.
- #want_authn_requests_signed? ⇒ Boolean
Methods inherited from SSO
#name_id_formats, #single_logout_services
Methods inherited from Role
#encryption_keys, #signing_keys
Methods included from Signable
#sign, #signature, #signed?, #signing_key, #valid_signature?, #validate_signature
Methods inherited from Base
from_xml, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml
Constructor Details
#initialize ⇒ IdentityProvider
Returns a new instance of IdentityProvider.
8 9 10 11 12 13 14 |
# File 'lib/saml2/identity_provider.rb', line 8 def initialize super @want_authn_requests_signed = nil @single_sign_on_services = [] @attribute_profiles = [] @attributes = [] end |
Instance Attribute Details
#attribute_profiles ⇒ Object
35 36 37 |
# File 'lib/saml2/identity_provider.rb', line 35 def attribute_profiles @attribute_profiles ||= load_string_array(xml, 'md:AttributeProfile') end |
#attributes ⇒ Object
39 40 41 |
# File 'lib/saml2/identity_provider.rb', line 39 def attributes @attributes ||= load_object_array(xml, 'saml:Attribute', Attribute) end |
#single_sign_on_services ⇒ Object
31 32 33 |
# File 'lib/saml2/identity_provider.rb', line 31 def single_sign_on_services @single_sign_on_services ||= load_object_array(xml, 'md:SingleSignOnService', Endpoint) end |
#want_authn_requests_signed=(value) ⇒ Object (writeonly)
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
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/saml2/identity_provider.rb', line 43 def build(builder) builder['md'].IDPSSODescriptor do |idp_sso_descriptor| super(idp_sso_descriptor) idp_sso_descriptor['WantAuthnRequestsSigned'] = want_authn_requests_signed? unless want_authn_requests_signed?.nil? single_sign_on_services.each do |sso| sso.build(idp_sso_descriptor, 'SingleSignOnService') end attribute_profiles.each do |ap| idp_sso_descriptor['md'].AttributeProfile(ap) end attributes.each do |attr| attr.build(idp_sso_descriptor) end end end |
#from_xml(node) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/saml2/identity_provider.rb', line 16 def from_xml(node) super remove_instance_variable(:@want_authn_requests_signed) @single_sign_on_services = nil @attribute_profiles = nil @attributes = nil end |
#want_authn_requests_signed? ⇒ Boolean
24 25 26 27 28 29 |
# File 'lib/saml2/identity_provider.rb', line 24 def want_authn_requests_signed? unless instance_variable_defined?(:@want_authn_requests_signed) @want_authn_requests_signed = xml['WantAuthnRequestsSigned'] && xml['WantAuthnRequestsSigned'] == 'true' end @want_authn_requests_signed end |