You are here

function _generate_metadata in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 7

2 calls to _generate_metadata()
miniorange_saml_metadata in ./miniorange_saml.module
miniorange_saml_metadata_download in ./miniorange_saml.module

File

./miniorange_saml.module, line 180
Module file for miniOrange SAML Module.

Code

function _generate_metadata($download = FALSE) {
  $b_url = Utilities::miniorange_get_baseURL();
  $issuer_id = Utilities::miniorange_get_issuer();
  substr($b_url, -1) == '/' ? $acs_url = $b_url . '?q=samlassertion' : ($acs_url = $b_url . '/?q=samlassertion');
  header('Content-Type: text/xml');
  if ($download) {
    header('Content-Disposition: attachment; filename="Metadata.xml"');
  }
  echo '<?xml version="1.0"?>
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" validUntil="2022-08-04T23:59:59Z" cacheDuration="PT1446808792S" entityID="' . $issuer_id . '">
  <md:SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
	<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>
	<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="' . $acs_url . '" index="1"/>
  </md:SPSSODescriptor>
  <md:Organization>
    <md:OrganizationName xml:lang="en-US">miniOrange</md:OrganizationName>
    <md:OrganizationDisplayName xml:lang="en-US">miniOrange</md:OrganizationDisplayName>
    <md:OrganizationURL xml:lang="en-US">http://miniorange.com</md:OrganizationURL>
  </md:Organization>
  <md:ContactPerson contactType="support">
    <md:GivenName>miniOrange</md:GivenName>
    <md:EmailAddress>info@xecurify.com</md:EmailAddress>
  </md:ContactPerson>
</md:EntityDescriptor>';
  exit;
}