Set the directory for configuration files for the given configuration set.
public static setConfigDir ( string $path, string $configSet = 'simplesaml' ) | ||
$path | string | The directory which contains the configuration files. |
$configSet | string | The configuration set. Defaults to 'simplesaml'. |
/** * Constructor * * Note that the person is tied to a OAuth datastore here */ function __construct($person = NULL) { parent::__construct($person); /* Find the path to simpelsamlphp and run the autoloader */ try { $sspdir = Config::get_config('simplesaml_path'); } catch (KeyNotFoundException $knfe) { echo "Cannot find path to simplesaml. This install is not valid. Aborting.<br />\n"; Logger::log_event(LOG_ALERT, "Trying to instantiate simpleSAMLphp without a configured path."); exit(0); } require_once $sspdir . '/lib/_autoload.php'; SimpleSAML_Configuration::setConfigDir($sspdir . '/config'); $this->oauthStore = new OAuthDataStore_Confusa(); $this->oauthServer = new sspmod_oauth_OAuthServer($this->oauthStore); $hmac_method = new OAuthSignatureMethod_HMAC_SHA1(); $this->oauthServer->add_signature_method($hmac_method); $req = OAuthRequest::from_request(); list($consumer, $this->accessToken) = $this->oauthServer->verify_request($req); $this->isAuthenticated = isset($this->accessToken); }
* based on an XML metadata file. */ /* This is the base directory of the simpleSAMLphp installation. */ $baseDir = dirname(dirname(dirname(dirname(__FILE__)))); /* Add library autoloader. */ require_once $baseDir . '/lib/_autoload.php'; SimpleSAML_Session::useTransientSession(); /* No need to try to create a session here. */ if (!SimpleSAML_Module::isModuleEnabled('metarefresh')) { echo "You need to enable the metarefresh module before this script can be used.\n"; echo "You can enable it by running the following command:\n"; echo ' echo >"' . $baseDir . '/modules/metarefresh/enable' . "\"\n"; exit(1); } /* Initialize the configuration. */ SimpleSAML_Configuration::setConfigDir($baseDir . '/config'); /* $outputDir contains the directory we will store the generated metadata in. */ $outputDir = $baseDir . '/metadata-generated'; /* $toStdOut is a boolean telling us wheter we will print the output to stdout instead * of writing it to files in $outputDir. */ $toStdOut = FALSE; /* $validateFingerprint contains the fingerprint of the certificate which should have been used * to sign the EntityDescriptor in the metadata, or NULL if fingerprint validation shouldn't be * done. */ $validateFingerprint = NULL; /* This variable contains the files we will parse. */ $files = array(); /* Parse arguments. */ $progName = array_shift($argv);
#!/usr/bin/env php <?php /* This is the base directory of the simpleSAMLphp installation. */ $baseDir = dirname(dirname(dirname(dirname(__FILE__)))); /* Add library autoloader. */ require_once $baseDir . '/lib/_autoload.php'; /* Initialize the configuration. */ $configdir = SimpleSAML\Utils\Config::getConfigDir(); SimpleSAML_Configuration::setConfigDir($configdir); SimpleSAML\Utils\Time::initTimezone(); $progName = array_shift($argv); $debug = FALSE; $dryrun = FALSE; foreach ($argv as $a) { if (strlen($a) === 0) { continue; } if (strpos($a, '=') !== FALSE) { $p = strpos($a, '='); $v = substr($a, $p + 1); $a = substr($a, 0, $p); } else { $v = NULL; } /* Map short options to long options. */ $shortOptMap = array('-d' => '--debug'); if (array_key_exists($a, $shortOptMap)) { $a = $shortOptMap[$a]; } switch ($a) { case '--help':
public function getDiscoPath() { $sspdir = Config::get_config('simplesaml_path'); require_once $sspdir . 'lib/_autoload.php'; SimpleSAML_Configuration::setConfigDir($sspdir . '/config'); $sspConfig = SimpleSAML_Configuration::getInstance(); $discoPath = "https://" . $_SERVER['SERVER_NAME'] . "/" . $sspConfig->getString('baseurlpath') . "module.php/saml/disco.php?" . $_SERVER['QUERY_STRING']; return $discoPath; }