@@ -14,10 +14,11 @@ class Metadata
1414 # @param valid_until [DateTime] Metadata's valid time
1515 # @param cache_duration [Integer] Duration of the cache in seconds
1616 # @return [String] XML Metadata of the Service Provider
17- def generate ( settings , pretty_print = false , valid_until = nil , cache_duration = nil )
17+ def generate ( settings , pretty_print = false , valid_until = nil , cache_duration = nil )
1818 builder = Nokogiri ::XML ::Builder . new ( encoding : 'UTF-8' ) do |xml |
1919 root_attributes = {
20- 'xmlns:md' => 'urn:oasis:names:tc:SAML:2.0:metadata' ,
20+ 'xmlns:md' => RubySaml ::XML ::NS_METADATA ,
21+ 'xmlns:ds' => RubySaml ::XML ::DSIG ,
2122 'ID' => RubySaml ::Utils . uuid ,
2223 'entityID' => settings . sp_entity_id
2324 }
@@ -151,7 +152,7 @@ def output_xml(meta_doc, pretty_print)
151152 def add_certificate_element ( xml , cert , use )
152153 cert_text = Base64 . strict_encode64 ( cert . to_der )
153154 xml [ 'md' ] . KeyDescriptor ( 'use' => use . to_s ) do
154- xml [ 'ds' ] . KeyInfo ( 'xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#' ) do
155+ xml [ 'ds' ] . KeyInfo do
155156 xml [ 'ds' ] . X509Data do
156157 xml [ 'ds' ] . X509Certificate ( cert_text )
157158 end
0 commit comments