Skip to content
Snippets Groups Projects
Commit 2b4e4ef1 authored by Olav Morken's avatar Olav Morken
Browse files

saml: Add metadata to frontpage.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1745 44740490-163a-0410-bde0-09ae8108e29a
parent 4b787cf3
No related branches found
No related tags found
No related merge requests found
<?php
/**
* Hook to add the metadata for hosted entities to the frontpage.
*
* @param array &$metadataHosted The metadata links for hosted metadata on the frontpage.
*/
function saml_hook_metadata_hosted(&$metadataHosted) {
assert('is_array($metadataHosted)');
$sources = SimpleSAML_Auth_Source::getSourcesOfType('saml:SP');
foreach ($sources as $source) {
$metadata = $source->getMetadata();
$name = $metadata->getValue('name', NULL);
if ($name === NULL) {
$name = $source->getAuthID();
}
$md = array(
'entityid' => $source->getEntityId(),
'metadata-index' => $source->getEntityId(),
'metadata-set' => 'saml20-sp-hosted',
'metadata-url' => $source->getMetadataURL() . '?output=xhtml',
'name' => $name,
);
$metadataHosted[] = $md;
}
}
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