4 require_once
'libs/composer/vendor/autoload.php';
5 require_once
'Services/Saml/interfaces/interface.ilSamlAuth.php';
28 public function __construct($authSourceName, $configurationPath)
35 $sessionHandler = $this->config->getString(
'session.handler',
false);
36 $storageType = $this->config->getString(
'store.type',
false);
39 $storageType ==
'phpsession' || $sessionHandler ==
'phpsession' ||
40 (empty($storageType) && empty($sessionHandler))
42 throw new RuntimeException(
'Invalid SimpleSAMLphp session handler: Must not be phpsession');
56 $templateHandler->
copy(
'./Services/Saml/lib/config.php.dist',
'auth/saml/config/config.php', [
57 'DB_PATH' => rtrim($configurationPath,
'/') .
'/ssphp.sq3',
58 'SQL_INITIAL_PASSWORD' =>
function () {
59 require_once
'Services/Password/classes/class.ilPasswordUtils.php';
65 $templateHandler->copy(
'./Services/Saml/lib/authsources.php.dist',
'auth/saml/config/authsources.php', [
66 'RELAY_STATE' => rtrim(ILIAS_HTTP_PATH,
'/') .
'/saml.php',
67 'SP_ENTITY_ID' => rtrim(ILIAS_HTTP_PATH,
'/') .
'/Services/Saml/lib/metadata.php' 76 return $this->authSource->getAuthSource()->getAuthId();
84 $this->authSource->requireAuth();
125 return $this->authSource->isAuthenticated();
133 return $this->authSource->getAttributes();
144 'ReturnStateParam' =>
'LogoutState',
145 'ReturnStateStage' =>
'ilLogoutState' 148 if (strlen($returnUrl) > 0) {
149 $params[
'ReturnTo'] = $returnUrl;
152 $this->authSource->logout(
$params);
168 return $this->authSource->getAuthDataArray();
initConfigFiles($configurationPath)
protectResource()
Protect a script resource with a SAML auth.
static set($a_var, $a_val)
Set a value.
__construct($authSourceName, $configurationPath)
ilSimpleSAMLphpWrapper constructor.
static getBytes($length)
Generate random bytes using OpenSSL or Mcrypt and mt_rand() as fallback.
static setConfigDir($path, $configSet='simplesaml')
Set the directory for configuration files for the given configuration set.
getIdpDiscovery()
ilSamlIdpDiscovery
copy($sourcePath, $destinationPath, array $placeholders=[])
static getInstance()
Get instance.
Class ilSimpleSAMLphpConfigTemplateHandler.
Class ilSimpleSAMLphpWrapper.
Class ilSimpleSAMLphplIdpDiscovery.
static getSessionFromRequest()
Retrieves the current session.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.