Example #1
0
/**
 * 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;
    }
}
Example #2
0
/**
 * Get all the configured IDentity Providers (IDP) as configured in SimpleSAMLPHP.
 *
 * @return bool|array an array with the IDP configurations, false on failure
 */
function simplesaml_get_configured_idp_sources()
{
    static $result;
    if (!isset($result)) {
        $result = false;
        if (class_exists("SimpleSAML_Auth_Source")) {
            $sources = SimpleSAML_Auth_Source::getSourcesOfType("authelgg:External");
            if (!empty($sources)) {
                $result = $sources;
            }
        }
    }
    return $result;
}