/** * Initializes the SimpleSAML_MetaShare_Store object. Only called by the getInstance * singleton accessor. */ private function __construct() { $metaConfig = SimpleSAML_Configuration::getConfig('metashare.php'); $this->metadataPath = $metaConfig->getString('metashare.path'); $this->metadataPath = SimpleSAML_Utilities::resolvePath($this->metadataPath); if (!is_dir($this->metadataPath)) { $ret = mkdir($this->metadataPath, 0755, TRUE); if (!$ret) { throw new Exception('Unable to create directory: ' . $this->metadataPath); } } }
/** * Resolves a path that may be relative to the cert-directory. * * @param string $path The (possibly relative) path to the file. * @return string The file path. */ public static function resolveCert($path) { assert('is_string($path)'); $globalConfig = SimpleSAML_Configuration::getInstance(); $base = $globalConfig->getPathValue('certdir', 'cert/'); return SimpleSAML_Utilities::resolvePath($path, $base); }
/** * Initialize this aggregator. * * @param string $id The id of this aggregator. * @param SimpleSAML_Configuration $config The configuration for this aggregator. */ protected function __construct($id, SimpleSAML_Configuration $config) { assert('is_string($id)'); $this->id = $id; $this->logLoc = 'aggregator2:' . $this->id . ': '; $this->cronTag = $config->getString('cron.tag', NULL); $this->cacheDirectory = $config->getString('cache.directory', NULL); if ($this->cacheDirectory !== NULL) { $this->cacheDirectory = SimpleSAML_Utilities::resolvePath($this->cacheDirectory); } $this->cacheGenerated = $config->getInteger('cache.generated', NULL); if ($this->cacheGenerated !== NULL) { $this->cacheId = sha1($this->id); $this->cacheTag = sha1(serialize($config)); } // configure entity IDs excluded by default $this->excludeEntities($config->getArrayize('exclude', null)); // configure filters $this->setFilters($config->getArrayize('filter', null)); $this->validLength = $config->getInteger('valid.length', 7 * 24 * 60 * 60); $globalConfig = SimpleSAML_Configuration::getInstance(); $certDir = $globalConfig->getPathValue('certdir', 'cert/'); $signKey = $config->getString('sign.privatekey', NULL); if ($signKey !== NULL) { $signKey = SimpleSAML_Utilities::resolvePath($signKey, $certDir); $this->signKey = @file_get_contents($signKey); if ($this->signKey === NULL) { throw new SimpleSAML_Error_Exception('Unable to load private key from ' . var_export($signKey, TRUE)); } } $this->signKeyPass = $config->getString('sign.privatekey_pass', NULL); $signCert = $config->getString('sign.certificate', NULL); if ($signCert !== NULL) { $signCert = SimpleSAML_Utilities::resolvePath($signCert, $certDir); $this->signCert = @file_get_contents($signCert); if ($this->signCert === NULL) { throw new SimpleSAML_Error_Exception('Unable to load certificate file from ' . var_export($signCert, TRUE)); } } $this->sslCAFile = $config->getString('ssl.cafile', NULL); $this->regInfo = $config->getArray('RegistrationInfo', NULL); $this->initSources($config->getConfigList('sources')); }
SimpleSAML_Logger::warning('SAML2.0 - IdP.SingleLogoutService: Lost logout information.'); } } /** * This function saves the logout info with the given ID. * * @param $id The identifier the logout info should be saved with. */ function saveLogoutInfo($id) { global $session; global $logoutInfo; $session->setData('idplogoutresponsedata', $id, $logoutInfo); } // Include XAJAX definition. require_once SimpleSAML_Utilities::resolvePath('libextinc') . '/xajax/xajax.inc.php'; /* * This function is called via AJAX and will send LogoutRequest to one single SP by * sending a LogoutRequest using HTTP-REDIRECT */ function updateslostatus() { SimpleSAML_Logger::info('SAML2.0 - IdP.SingleLogoutServiceiFrame: Accessing SAML 2.0 IdP endpoint SingleLogoutService (iFrame version) within updateslostatus() '); $config = SimpleSAML_Configuration::getInstance(); $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler(); $session = SimpleSAML_Session::getInstance(); $idpentityid = $metadata->getMetaDataCurrentEntityID('saml20-idp-hosted'); $templistofsps = $session->get_sp_list(SimpleSAML_Session::STATE_ONLINE); $listofsps = array(); foreach ($templistofsps as $spentityid) { if (!empty($_COOKIE['spstate-' . sha1($spentityid)])) {