diff --git a/module/VuFind/src/VuFind/Auth/AbstractBase.php b/module/VuFind/src/VuFind/Auth/AbstractBase.php index 9a48348279e2ba28159cc202918539c92629226c..aeeda81263609ddcc25e3246752af3b290a3fd5c 100644 --- a/module/VuFind/src/VuFind/Auth/AbstractBase.php +++ b/module/VuFind/src/VuFind/Auth/AbstractBase.php @@ -42,17 +42,55 @@ use VuFind\Config\Reader as ConfigReader, */ abstract class AbstractBase { - protected $config; + protected $configValidated = false; + protected $config = null; /** - * Constructor + * Get configuration (load automatically if not previously set). Throw an + * exception if the configuration is invalid. * - * @param object $config Optional configuration object to pass through (loads - * default configuration if none specified). + * @throws AuthException + * @return \Zend\Config\Config + */ + public function getConfig() + { + // Load configuration if not already present: + if (is_null($this->config)) { + $this->setConfig(ConfigReader::getConfig()); + } + + // Validate configuration if not already validated: + if (!$this->configValidated) { + $this->validateConfig(); + } + + return $this->config; + } + + /** + * Set configuration. + * + * @param \Zend\Config\Config $config Configuration to set + * + * @return void + */ + public function setConfig($config) + { + $this->config = $config; + $this->configValidated = false; + } + + /** + * Validate configuration parameters. This is a support method for getConfig(), + * so the configuration MUST be accessed using $this->config; do not call + * $this->getConfig() from within this method! + * + * @throws AuthException + * @return void */ - public function __construct($config = null) + protected function validateConfig() { - $this->config = is_null($config) ? ConfigReader::getConfig() : $config; + // By default, do no checking. } /** diff --git a/module/VuFind/src/VuFind/Auth/Factory.php b/module/VuFind/src/VuFind/Auth/Factory.php index dc74ed491d592759c6e74afdeefffed4c6cbdcc6..1b85153141d6678a67ca23b7a6a012cbe606a198 100644 --- a/module/VuFind/src/VuFind/Auth/Factory.php +++ b/module/VuFind/src/VuFind/Auth/Factory.php @@ -64,7 +64,10 @@ class Factory // Load up the handler if a legal name has been supplied. $className = 'VuFind\Auth\\' . $authNHandler; if (class_exists($className)) { - return new $className($config); + $obj = new $className(); + if (null !== $config) { + $obj->setConfig($config); + } } else { throw new AuthException( 'Authentication handler ' . $authNHandler . ' does not exist!' diff --git a/module/VuFind/src/VuFind/Auth/ILS.php b/module/VuFind/src/VuFind/Auth/ILS.php index 6982defb6642f917b3bc3ee6eb40d9e93738d6c5..68b3e98aa0bb3f7f0266391e06c4c7a5f1ad6201 100644 --- a/module/VuFind/src/VuFind/Auth/ILS.php +++ b/module/VuFind/src/VuFind/Auth/ILS.php @@ -115,8 +115,9 @@ class ILS extends AbstractBase { // Figure out which field of the response to use as an identifier; fail // if the expected field is missing or empty: - $usernameField = isset($this->config->Authentication->ILS_username_field) - ? $this->config->Authentication->ILS_username_field : 'cat_username'; + $config = $this->getConfig(); + $usernameField = isset($config->Authentication->ILS_username_field) + ? $config->Authentication->ILS_username_field : 'cat_username'; if (!isset($info[$usernameField]) || empty($info[$usernameField])) { throw new AuthException('authentication_error_technical'); } diff --git a/module/VuFind/src/VuFind/Auth/LDAP.php b/module/VuFind/src/VuFind/Auth/LDAP.php index 674cf71235653cd7bc3dd7c96aebf65254bc1104..b730af25dfafab3b56a07cff683354aed81ade1a 100644 --- a/module/VuFind/src/VuFind/Auth/LDAP.php +++ b/module/VuFind/src/VuFind/Auth/LDAP.php @@ -45,21 +45,9 @@ class LDAP extends AbstractBase protected $password; /** - * Constructor - * - * @param object $config Optional configuration object to pass through (loads - * default configuration if none specified). - * - * @throws AuthException - */ - public function __construct($config = null) - { - parent::__construct($config); - $this->validateConfig(); - } - - /** - * Validate configuration parameters. + * Validate configuration parameters. This is a support method for getConfig(), + * so the configuration MUST be accessed using $this->config; do not call + * $this->getConfig() from within this method! * * @throws AuthException * @return void @@ -80,16 +68,16 @@ class LDAP extends AbstractBase } /** - * Get the requested configuration parameter (or blank string if unset). + * Get the requested configuration setting (or blank string if unset). * * @param string $name Name of parameter to retrieve. * * @return string */ - protected function getConfig($name) + protected function getSetting($name) { - $value = isset($this->config->LDAP->$name) - ? $this->config->LDAP->$name : ''; + $config = $this->getConfig(); + $value = isset($config->LDAP->$name) ? $config->LDAP->$name : ''; // Normalize all values to lowercase except for potentially case-sensitive // bind and basedn credentials. @@ -129,7 +117,7 @@ class LDAP extends AbstractBase // is unavailable -- we need to check for bad return values again at search // time! $ldapConnection = @ldap_connect( - $this->getConfig('host'), $this->getConfig('port') + $this->getSetting('host'), $this->getSetting('port') ); if (!$ldapConnection) { throw new AuthException('authentication_error_technical'); @@ -141,7 +129,7 @@ class LDAP extends AbstractBase // if the host parameter is not specified as ldaps:// // then we need to initiate TLS so we // can have a secure connection over the standard LDAP port. - if (stripos($this->getConfig('host'), 'ldaps://') === false) { + if (stripos($this->getSetting('host'), 'ldaps://') === false) { if (!@ldap_start_tls($ldapConnection)) { throw new AuthException('authentication_error_technical'); } @@ -150,12 +138,12 @@ class LDAP extends AbstractBase // If bind_username and bind_password were supplied in the config file, use // them to access LDAP before proceeding. In some LDAP setups, these // settings can be excluded in order to skip this step. - if ($this->getConfig('bind_username') != '' - && $this->getConfig('bind_password') != '' + if ($this->getSetting('bind_username') != '' + && $this->getSetting('bind_password') != '' ) { $ldapBind = @ldap_bind( - $ldapConnection, $this->getConfig('bind_username'), - $this->getConfig('bind_password') + $ldapConnection, $this->getSetting('bind_username'), + $this->getSetting('bind_password') ); if (!$ldapBind) { throw new AuthException('authentication_error_technical'); @@ -163,9 +151,9 @@ class LDAP extends AbstractBase } // Search for username - $ldapFilter = $this->getConfig('username') . '=' . $this->username; + $ldapFilter = $this->getSetting('username') . '=' . $this->username; $ldapSearch = @ldap_search( - $ldapConnection, $this->getConfig('basedn'), $ldapFilter + $ldapConnection, $this->getSetting('basedn'), $ldapFilter ); if (!$ldapSearch) { throw new AuthException('authentication_error_technical'); @@ -180,7 +168,7 @@ class LDAP extends AbstractBase if ($ldapBind) { // If the bind was successful, we can look up the full user info: $ldapSearch = ldap_search( - $ldapConnection, $this->getConfig('basedn'), $ldapFilter + $ldapConnection, $this->getSetting('basedn'), $ldapFilter ); $data = ldap_get_entries($ldapConnection, $ldapSearch); return $this->processLDAPUser($data); @@ -214,7 +202,7 @@ class LDAP extends AbstractBase for ($i = 0; $i < $data["count"]; $i++) { for ($j = 0; $j < $data[$i]["count"]; $j++) { foreach ($fields as $field) { - $configValue = $this->getConfig($field); + $configValue = $this->getSetting($field); if ($data[$i][$j] == $configValue && !empty($configValue)) { $user->$field = $data[$i][$data[$i][$j]][0]; } diff --git a/module/VuFind/src/VuFind/Auth/MultiAuth.php b/module/VuFind/src/VuFind/Auth/MultiAuth.php index bd5b1976e4e68e3675401462c7c4c5e3f1f11232..3a604ffa0bc4b9bcf1cf12ff9a83fb76a79c5771 100644 --- a/module/VuFind/src/VuFind/Auth/MultiAuth.php +++ b/module/VuFind/src/VuFind/Auth/MultiAuth.php @@ -64,33 +64,51 @@ use VuFind\Exception\Auth as AuthException; class MultiAuth extends AbstractBase { protected $filters = array(); - protected $methods; + protected $methods = array(); protected $username; protected $password; /** - * Constructor + * Validate configuration parameters. This is a support method for getConfig(), + * so the configuration MUST be accessed using $this->config; do not call + * $this->getConfig() from within this method! * - * @param object $config Optional configuration object to pass through (loads - * default configuration if none specified). + * @throws AuthException + * @return void */ - public function __construct($config = null) + protected function validateConfig() { - parent::__construct($config); - - if (!isset($config->MultiAuth) || !isset($config->MultiAuth->method_order) - || !strlen($config->MultiAuth->method_order) + if (!isset($this->config->MultiAuth) + || !isset($this->config->MultiAuth->method_order) + || !strlen($this->config->MultiAuth->method_order) ) { throw new AuthException( "One or more MultiAuth parameters are missing. " . "Check your config.ini!" ); } - $this->methods = explode(',', $config->MultiAuth->method_order); + } + + /** + * Set configuration; throw an exception if it is invalid. + * + * @param \Zend\Config\Config $config Configuration to set + * + * @throws AuthException + * @return void + */ + public function setConfig($config) + { + parent::setConfig($config); + $this->methods = array_map( + 'trim', explode(',', $config->MultiAuth->method_order) + ); if (isset($config->MultiAuth->filters) && strlen($config->MultiAuth->filters) ) { - $this->filters = explode(',', $config->MultiAuth->filters); + $this->filters = array_map( + 'trim', explode(',', $config->MultiAuth->filters) + ); } } @@ -156,7 +174,7 @@ class MultiAuth extends AbstractBase { // Try authentication methods until we find one that works: foreach ($this->methods as $method) { - $authenticator = Factory::getAuth(trim($method), $this->config); + $authenticator = Factory::getAuth(trim($method), $this->getConfig()); try { $user = $authenticator->authenticate($request); diff --git a/module/VuFind/src/VuFind/Auth/SIP2.php b/module/VuFind/src/VuFind/Auth/SIP2.php index 9c9c2b1263cb6cd1d78869135f16dece3a3a6886..9f520c4960c1bc558e6cd1605595f0fb6e1b74c8 100644 --- a/module/VuFind/src/VuFind/Auth/SIP2.php +++ b/module/VuFind/src/VuFind/Auth/SIP2.php @@ -57,12 +57,13 @@ class SIP2 extends AbstractBase if ($username == '' || $password == '') { throw new AuthException('authentication_error_blank'); } - + // Attempt SIP2 Authentication $mysip = new \sip2(); - if (isset($this->config->SIP2)) { - $mysip->hostname = $this->config->SIP2->host; - $mysip->port = $this->config->SIP2->port; + $config = $this->getConfig(); + if (isset($config->SIP2)) { + $mysip->hostname = $config->SIP2->host; + $mysip->port = $config->SIP2->port; } if (!$mysip->connect()) { diff --git a/module/VuFind/src/VuFind/Auth/Shibboleth.php b/module/VuFind/src/VuFind/Auth/Shibboleth.php index b195bb27cde2396634c5777bae112b7a74fcae8c..aee35e1e4baee3d449d5680f9224d6e3b77a021a 100644 --- a/module/VuFind/src/VuFind/Auth/Shibboleth.php +++ b/module/VuFind/src/VuFind/Auth/Shibboleth.php @@ -42,15 +42,14 @@ use VuFind\Db\Table\User as UserTable, VuFind\Exception\Auth as AuthException; class Shibboleth extends AbstractBase { /** - * Attempt to authenticate the current user. Throws exception if login fails. - * - * @param \Zend\Http\PhpEnvironment\Request $request Request object containing - * account credentials. + * Validate configuration parameters. This is a support method for getConfig(), + * so the configuration MUST be accessed using $this->config; do not call + * $this->getConfig() from within this method! * * @throws AuthException - * @return \VuFind\Db\Row\User Object representing logged-in user. + * @return void */ - public function authenticate($request) + protected function validateConfig() { // Throw an exception if the required username setting is missing. $shib = $this->config->Shibboleth; @@ -60,7 +59,26 @@ class Shibboleth extends AbstractBase ); } + if (!isset($shib->login)) { + throw new AuthException( + 'Shibboleth login configuration parameter is not set.' + ); + } + } + + /** + * Attempt to authenticate the current user. Throws exception if login fails. + * + * @param \Zend\Http\PhpEnvironment\Request $request Request object containing + * account credentials. + * + * @throws AuthException + * @return \VuFind\Db\Row\User Object representing logged-in user. + */ + public function authenticate($request) + { // Check if username is set. + $shib = $this->getConfig()->Shibboleth; $username = $request->getServer()->get($shib->username); if (empty($username)) { throw new AuthException('authentication_error_admin'); @@ -104,23 +122,18 @@ class Shibboleth extends AbstractBase */ public function getSessionInitiator($target) { - if (!isset($this->config->Shibboleth->login)) { - throw new AuthException( - 'Shibboleth login configuration parameter is not set.' - ); - } - - if (isset($this->config->Shibboleth->target)) { - $shibTarget = $this->config->Shibboleth->target; + $config = $this->getConfig(); + if (isset($config->Shibboleth->target)) { + $shibTarget = $config->Shibboleth->target; } else { $shibTarget = $target; } - $sessionInitiator = $this->config->Shibboleth->login + $sessionInitiator = $config->Shibboleth->login . '?target=' . urlencode($shibTarget); - if (isset($this->config->Shibboleth->provider_id)) { + if (isset($config->Shibboleth->provider_id)) { $sessionInitiator = $sessionInitiator . '&providerId=' . - urlencode($this->config->Shibboleth->provider_id); + urlencode($config->Shibboleth->provider_id); } return $sessionInitiator; @@ -133,14 +146,15 @@ class Shibboleth extends AbstractBase */ public function isExpired() { - if (isset($this->config->Shibboleth->username) - && isset($this->config->Shibboleth->logout) + $config = $this->getConfig(); + if (isset($config->Shibboleth->username) + && isset($config->Shibboleth->logout) ) { // It would be more proper to call getServer on a Zend request // object... except that the request object doesn't exist yet when // this routine gets called. - $username = isset($_SERVER[$this->config->Shibboleth->username]) - ? $_SERVER[$this->config->Shibboleth->username] : null; + $username = isset($_SERVER[$config->Shibboleth->username]) + ? $_SERVER[$config->Shibboleth->username] : null; return empty($username); } return false; @@ -157,10 +171,11 @@ class Shibboleth extends AbstractBase public function logout($url) { // If single log-out is enabled, use a special URL: - if (isset($this->config->Shibboleth->logout) - && !empty($this->config->Shibboleth->logout) + $config = $this->getConfig(); + if (isset($config->Shibboleth->logout) + && !empty($config->Shibboleth->logout) ) { - $url = $this->config->Shibboleth->logout . '?return=' . urlencode($url); + $url = $config->Shibboleth->logout . '?return=' . urlencode($url); } // Send back the redirect URL (possibly modified): @@ -178,7 +193,7 @@ class Shibboleth extends AbstractBase $sortedUserAttributes = array(); // Now extract user attribute values: - $shib = $this->config->Shibboleth; + $shib = $this->getConfig()->Shibboleth; foreach ($shib as $key => $value) { if (preg_match("/userattribute_[0-9]{1,}/", $key)) { $valueKey = 'userattribute_value_' . substr($key, 14); diff --git a/module/VuFind/tests/Auth/LDAPTest.php b/module/VuFind/tests/Auth/LDAPTest.php index be00bd31df65d7f56e7370c0776f6b342b276c81..be3ea928f90165a314eba723c02fa6c02e970e65 100644 --- a/module/VuFind/tests/Auth/LDAPTest.php +++ b/module/VuFind/tests/Auth/LDAPTest.php @@ -51,7 +51,9 @@ class LDAPTest extends \VuFind\Tests\TestCase if (null === $config) { $config = $this->getAuthConfig(); } - return new LDAP($config); + $obj = new LDAP(); + $obj->setConfig($config); + return $obj; } /** @@ -82,7 +84,7 @@ class LDAPTest extends \VuFind\Tests\TestCase $this->setExpectedException('VuFind\Exception\Auth'); $config = $this->getAuthConfig(); unset($config->LDAP->host); - $this->getAuthObject($config); + $this->getAuthObject($config)->getConfig(); } /** @@ -95,7 +97,7 @@ class LDAPTest extends \VuFind\Tests\TestCase $this->setExpectedException('VuFind\Exception\Auth'); $config = $this->getAuthConfig(); unset($config->LDAP->port); - $this->getAuthObject($config); + $this->getAuthObject($config)->getConfig(); } /** @@ -108,7 +110,7 @@ class LDAPTest extends \VuFind\Tests\TestCase $this->setExpectedException('VuFind\Exception\Auth'); $config = $this->getAuthConfig(); unset($config->LDAP->basedn); - $this->getAuthObject($config); + $this->getAuthObject($config)->getConfig(); } /** @@ -121,7 +123,7 @@ class LDAPTest extends \VuFind\Tests\TestCase $this->setExpectedException('VuFind\Exception\Auth'); $config = $this->getAuthConfig(); unset($config->LDAP->username); - $this->getAuthObject($config); + $this->getAuthObject($config)->getConfig(); } /** @@ -138,12 +140,12 @@ class LDAPTest extends \VuFind\Tests\TestCase // username should be lowercased: $this->assertEquals( 'upper', - $this->callMethod($auth, 'getConfig', array('username')) + $this->callMethod($auth, 'getSetting', array('username')) ); // basedn should not: $this->assertEquals( 'MixedCase', - $this->callMethod($auth, 'getConfig', array('basedn')) + $this->callMethod($auth, 'getSetting', array('basedn')) ); } diff --git a/module/VuFind/tests/Auth/MultiAuthTest.php b/module/VuFind/tests/Auth/MultiAuthTest.php new file mode 100644 index 0000000000000000000000000000000000000000..0e741bc49a58271ebb7417c693a2fb33d86745cd --- /dev/null +++ b/module/VuFind/tests/Auth/MultiAuthTest.php @@ -0,0 +1,128 @@ +<?php +/** + * MultiAuth authentication test class. + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Tests + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://www.vufind.org Main Page + */ +namespace VuFind\Tests\Auth; +use VuFind\Auth\MultiAuth, Zend\Config\Config; + +/** + * LDAP authentication test class. + * + * @category VuFind2 + * @package Tests + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://www.vufind.org Main Page + */ +class MultiAuthTest extends \VuFind\Tests\TestCase +{ + /** + * Get an authentication object. + * + * @param Config $config Configuration to use (null for default) + * + * @return LDAP + */ + public function getAuthObject($config = null) + { + if (null === $config) { + $config = $this->getAuthConfig(); + } + $obj = new MultiAuth(); + $obj->setConfig($config); + return $obj; + } + + /** + * Get a working configuration for the LDAP object + * + * @return Config + */ + public function getAuthConfig() + { + $config = new Config( + array( + 'method_order' => 'Database,ILS' + ), true + ); + return new Config(array('MultiAuth' => $config), true); + } + + /** + * Verify that missing host causes failure. + * + * @return void + */ + public function testWithMissingMethodOrder() + { + $this->setExpectedException('VuFind\Exception\Auth'); + $config = $this->getAuthConfig(); + unset($config->MultiAuth->method_order); + $this->getAuthObject($config)->getConfig(); + } + + /** + * Support method -- get parameters to log into an account (but allow override of + * individual parameters so we can test different scenarios). + * + * @param array $overrides Associative array of parameters to override. + * + * @return \Zend\Http\Request + */ + protected function getLoginRequest($overrides = array()) + { + $post = $overrides + array( + 'username' => 'testuser', 'password' => 'testpass' + ); + $request = new \Zend\Http\Request(); + $request->setPost(new \Zend\Stdlib\Parameters($post)); + return $request; + } + + /** + * Test login with blank username. + * + * @return void + */ + public function testLoginWithBlankUsername() + { + $this->setExpectedException('VuFind\Exception\Auth'); + $request = $this->getLoginRequest(array('username' => '')); + $this->getAuthObject()->authenticate($request); + } + + /** + * Test login with blank password. + * + * @return void + */ + public function testLoginWithBlankPassword() + { + $this->setExpectedException('VuFind\Exception\Auth'); + $request = $this->getLoginRequest(array('password' => '')); + $this->getAuthObject()->authenticate($request); + } +} \ No newline at end of file diff --git a/module/VuFind/tests/Auth/SIP2Test.php b/module/VuFind/tests/Auth/SIP2Test.php new file mode 100644 index 0000000000000000000000000000000000000000..ee06854b26db6a0335d13dd5cc89b3efb1e7fd2a --- /dev/null +++ b/module/VuFind/tests/Auth/SIP2Test.php @@ -0,0 +1,116 @@ +<?php +/** + * SIP2 authentication test class. + * + * PHP version 5 + * + * Copyright (C) Villanova University 2011. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * @category VuFind2 + * @package Tests + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://www.vufind.org Main Page + */ +namespace VuFind\Tests\Auth; +use VuFind\Auth\SIP2, Zend\Config\Config; + +/** + * SIP2 authentication test class. + * + * @category VuFind2 + * @package Tests + * @author Demian Katz <demian.katz@villanova.edu> + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://www.vufind.org Main Page + */ +class SIP2Test extends \VuFind\Tests\TestCase +{ + /** + * Get an authentication object. + * + * @param Config $config Configuration to use (null for default) + * + * @return LDAP + */ + public function getAuthObject($config = null) + { + if (null === $config) { + $config = $this->getAuthConfig(); + } + $obj = new SIP2(); + $obj->setConfig($config); + return $obj; + } + + /** + * Get a working configuration for the LDAP object + * + * @return Config + */ + public function getAuthConfig() + { + $config = new Config( + array( + 'host' => 'my.fake.host', + 'port' => '6002' + ), true + ); + return new Config(array('MultiAuth' => $config), true); + } + + /** + * Support method -- get parameters to log into an account (but allow override of + * individual parameters so we can test different scenarios). + * + * @param array $overrides Associative array of parameters to override. + * + * @return \Zend\Http\Request + */ + protected function getLoginRequest($overrides = array()) + { + $post = $overrides + array( + 'username' => 'testuser', 'password' => 'testpass' + ); + $request = new \Zend\Http\Request(); + $request->setPost(new \Zend\Stdlib\Parameters($post)); + return $request; + } + + /** + * Test login with blank username. + * + * @return void + */ + public function testLoginWithBlankUsername() + { + $this->setExpectedException('VuFind\Exception\Auth'); + $request = $this->getLoginRequest(array('username' => '')); + $this->getAuthObject()->authenticate($request); + } + + /** + * Test login with blank password. + * + * @return void + */ + public function testLoginWithBlankPassword() + { + $this->setExpectedException('VuFind\Exception\Auth'); + $request = $this->getLoginRequest(array('password' => '')); + $this->getAuthObject()->authenticate($request); + } +} \ No newline at end of file diff --git a/module/VuFind/tests/Auth/ShibbolethTest.php b/module/VuFind/tests/Auth/ShibbolethTest.php index 3455517b3da0b3fe6f1d409acfc2525c69e913ac..738b3985da9c5c449c410b7024e5f96e2883829b 100644 --- a/module/VuFind/tests/Auth/ShibbolethTest.php +++ b/module/VuFind/tests/Auth/ShibbolethTest.php @@ -69,7 +69,9 @@ class ShibbolethTest extends \VuFind\Tests\DbTestCase if (null === $config) { $config = $this->getAuthConfig(); } - return new Shibboleth($config); + $obj = new Shibboleth(); + $obj->setConfig($config); + return $obj; } /**