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

Move IdP enabled check into SimpleSAML_IdP.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2125 44740490-163a-0410-bde0-09ae8108e29a
parent b622b7b5
No related branches found
No related tags found
No related merge requests found
......@@ -45,9 +45,17 @@ class SimpleSAML_IdP {
$this->id = $id;
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
$globalConfig = SimpleSAML_Configuration::getInstance();
if (substr($id, 0, 6) === 'saml2:') {
if (!$globalConfig->getBoolean('enable.saml20-idp', FALSE)) {
throw new SimpleSAML_Error_Exception('enable.saml20-idp disabled in config.php.');
}
$this->config = $metadata->getMetaDataConfig(substr($id, 6), 'saml20-idp-hosted');
} elseif (substr($id, 0, 6) === 'saml1:') {
if (!$globalConfig->getBoolean('enable.shib13-idp', FALSE)) {
throw new SimpleSAML_Error_Exception('enable.shib13-idp disabled in config.php.');
}
$this->config = $metadata->getMetaDataConfig(substr($id, 6), 'shib13-idp-hosted');
} else {
assert(FALSE);
......
......@@ -13,11 +13,6 @@ require_once('../../../www/_include.php');
SimpleSAML_Logger::info('SAML2.0 - IdP.SSOService: Accessing SAML 2.0 IdP endpoint SSOService');
$config = SimpleSAML_Configuration::getInstance();
if (!$config->getBoolean('enable.saml20-idp', FALSE)) {
throw new SimpleSAML_Error_Error('NOACCESS');
}
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
$idpEntityId = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted');
$idp = SimpleSAML_IdP::getById('saml2:' . $idpEntityId);
......
......@@ -13,11 +13,6 @@ require_once('../../../www/_include.php');
SimpleSAML_Logger::info('Shib1.3 - IdP.SSOService: Accessing Shibboleth 1.3 IdP endpoint SSOService');
$config = SimpleSAML_Configuration::getInstance();
if (!$config->getBoolean('enable.shib13-idp', FALSE)) {
throw new SimpleSAML_Error_Error('NOACCESS');
}
$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
$idpEntityId = $metadata->getMetaDataCurrentEntityID('shib13-idp-hosted');
$idp = SimpleSAML_IdP::getById('saml1:' . $idpEntityId);
......
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