Class: OneLogin::RubySaml::IdpMetadataParser
- Inherits:
-
Object
- Object
- OneLogin::RubySaml::IdpMetadataParser
- Defined in:
- lib/onelogin/ruby-saml/idp_metadata_parser.rb
Overview
Auxiliary class to retrieve and parse the Identity Provider Metadata
Constant Summary collapse
- METADATA =
"urn:oasis:names:tc:SAML:2.0:metadata"
- DSIG =
"http://www.w3.org/2000/09/xmldsig#"
- NAME_FORMAT =
"urn:oasis:names:tc:SAML:2.0:attrname-format:*"
- SAML_ASSERTION =
"urn:oasis:names:tc:SAML:2.0:assertion"
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#parse(idp_metadata, options = {}) ⇒ Object
Parse the Identity Provider metadata and update the settings with the IdP values.
-
#parse_remote(url, validate_cert = true, options = {}) ⇒ REXML::document
Parse the Identity Provider metadata and update the settings with the IdP values.
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
23 24 25 |
# File 'lib/onelogin/ruby-saml/idp_metadata_parser.rb', line 23 def document @document end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
24 25 26 |
# File 'lib/onelogin/ruby-saml/idp_metadata_parser.rb', line 24 def response @response end |
Instance Method Details
#parse(idp_metadata, options = {}) ⇒ Object
Parse the Identity Provider metadata and update the settings with the IdP values
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/onelogin/ruby-saml/idp_metadata_parser.rb', line 42 def parse(, = {}) @document = REXML::Document.new() settings = [:settings] if settings.nil? || settings.is_a?(Hash) settings = OneLogin::RubySaml::Settings.new(settings || {}) end settings.tap do |settings| settings.idp_entity_id = idp_entity_id settings.name_identifier_format = idp_name_id_format settings.idp_sso_target_url = single_signon_service_url() settings.idp_slo_target_url = single_logout_service_url() settings.idp_cert = certificate_base64 settings.idp_cert_fingerprint = fingerprint(settings.idp_cert_fingerprint_algorithm) settings.idp_attribute_names = attribute_names end end |
#parse_remote(url, validate_cert = true, options = {}) ⇒ REXML::document
Parse the Identity Provider metadata and update the settings with the IdP values
33 34 35 36 |
# File 'lib/onelogin/ruby-saml/idp_metadata_parser.rb', line 33 def parse_remote(url, validate_cert = true, = {}) = (url, validate_cert) parse(, ) end |