diff --git a/config/config_defaults.inc.php b/config/config_defaults.inc.php index d22e57f885ccbe92fb0c185de74d3860c72a9a67..16e33a9b30e2f27ffd40008e9b873c2f7cb87c7d 100644 --- a/config/config_defaults.inc.php +++ b/config/config_defaults.inc.php @@ -328,6 +328,7 @@ $STUDIP_AUTH_CONFIG_OAUTH2 = [ $STUDIP_AUTH_CONFIG_SIMPLESAMLPHP = [ 'sp_name' => 'default-sp', + 'path_to_simple_saml_php' => '/var/simplesamlphp/src/_autoload.php' // path to _autoload.php of SimpleSamlPHP library 'user_data_mapping' => [ 'auth_user_md5.Email' => ['callback' => 'getUserData', 'map_args' => 'email'], 'auth_user_md5.Nachname' => ['callback' => 'getUserData', 'map_args' => 'firstName'], diff --git a/lib/classes/auth_plugins/StudipAuthSimpleSamlPHP.php b/lib/classes/auth_plugins/StudipAuthSimpleSamlPHP.php index 69745a82024a1af1f4337fcc1548dd96cb8bc34e..18b7e36ff967ce00a975d08331b6e146c65cb357 100644 --- a/lib/classes/auth_plugins/StudipAuthSimpleSamlPHP.php +++ b/lib/classes/auth_plugins/StudipAuthSimpleSamlPHP.php @@ -16,6 +16,8 @@ class StudipAuthSimpleSamlPHP extends StudipAuthSSO // Name of attribute that contains username (if empty it will use NameID as username) public ?string $username_attribute = null; + public ?string $path_to_simple_saml_php = null; + public ?array $userdata = null; public SimpleSAML\Auth\Simple $as; @@ -26,6 +28,12 @@ class StudipAuthSimpleSamlPHP extends StudipAuthSSO { parent::__construct($config); + if(!isset($this->path_to_simple_saml_php)){ + require_once('/var/simplesamlphp/src/_autoload.php'); + }else{ + require_once($this->path_to_simple_saml_php ); + } + if (!isset($this->plugin_fullname)) { $this->plugin_fullname = _('SAML'); }