Skip to content
Snippets Groups Projects
Commit e5497693 authored by Jaime Perez's avatar Jaime Perez
Browse files

Migrate hosted IdP metadata to use the new getContact() helper function....

Migrate hosted IdP metadata to use the new getContact() helper function. Include also the contact information in SSP generated configuration. Honour contact configuration in hosted metadata, the same way as in hosted SP metadata. Solve #101.
parent 4efe184a
No related branches found
No related tags found
No related merge requests found
......@@ -158,20 +158,29 @@ try {
$metaArray['redirect.sign'] = $idpmeta->getBoolean('redirect.validate');
}
$metaflat = '$metadata[' . var_export($idpentityid, TRUE) . '] = ' . var_export($metaArray, TRUE) . ';';
if ($idpmeta->hasValue('contacts')) {
$contacts = $idpmeta->getArray('contacts');
foreach ($contacts as $contact) {
$metaArray['contacts'][] = SimpleSAML_Utils_Config_Metadata::getContact($contact);
}
}
$technicalContactEmail = $config->getString('technicalcontact_email', FALSE);
if ($technicalContactEmail && $technicalContactEmail !== 'na@example.org') {
$techcontact['emailAddress'] = $technicalContactEmail;
$techcontact['name'] = $config->getString('technicalcontact_name', NULL);
$techcontact['contactType'] = 'technical';
$metaArray['contacts'][] = SimpleSAML_Utils_Config_Metadata::getContact($techcontact);
}
$metaBuilder = new SimpleSAML_Metadata_SAMLBuilder($idpentityid);
$metaBuilder->addMetadataIdP20($metaArray);
$metaBuilder->addOrganizationInfo($metaArray);
$technicalContactEmail = $config->getString('technicalcontact_email', NULL);
if ($technicalContactEmail && $technicalContactEmail !== 'na@example.org') {
$metaBuilder->addContact('technical', array(
'emailAddress' => $technicalContactEmail,
'name' => $config->getString('technicalcontact_name', NULL),
));
}
$metaxml = $metaBuilder->getEntityDescriptorText();
$metaflat = '$metadata[' . var_export($idpentityid, TRUE) . '] = ' . var_export($metaArray, TRUE) . ';';
/* Sign the metadata if enabled. */
$metaxml = SimpleSAML_Metadata_Signer::sign($metaxml, $idpmeta->toArray(), 'SAML 2 IdP');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment