File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 821821` ` `
822822
823823The ` attribute_value` option additionally accepts an array of possible values.
824+
825+ # # Custom Metadata Fields
826+
827+ Some IdPs may require to add SPs to add additional fields (Organization, ContactPerson, etc.)
828+ into the SP metadata. This can be acheived by extending the ` OneLogin::RubySaml::Metadata`
829+ class and overriding the ` # add_extras` method as per the following example:
830+
831+ ` ` ` ruby
832+ class MyMetadata < OneLogin::RubySaml::Metadata
833+ def add_extras(root, _settings)
834+ org = root.add_element(" md:Organization" )
835+ org.add_element(" md:OrganizationName" , ' xml:lang' => " en-US" ).text = ' ACME Inc.'
836+ org.add_element(" md:OrganizationDisplayName" , ' xml:lang' => " en-US" ).text = ' ACME'
837+ org.add_element(" md:OrganizationURL" , ' xml:lang' => " en-US" ).text = ' https://www.acme.com'
838+
839+ cp = root.add_element(" md:ContactPerson" , ' contactType' => ' technical' )
840+ cp.add_element(" md:GivenName" ).text = ' ACME SAML Team'
841+ cp.add_element(" md:EmailAddress" ).text = ' saml@acme.com'
842+ end
843+ end
844+
845+ # Output XML with custom metadata
846+ MyMetadata.new.generate(settings)
847+ ` ` `
You can’t perform that action at this time.
0 commit comments