diff --git a/module/VuFind/src/VuFind/Controller/MyResearchController.php b/module/VuFind/src/VuFind/Controller/MyResearchController.php index 7769210f4825abb7dc0161206fc68b699ef2fe6c..82695b705920d3dc39f60387d5f2c63bb307caae 100644 --- a/module/VuFind/src/VuFind/Controller/MyResearchController.php +++ b/module/VuFind/src/VuFind/Controller/MyResearchController.php @@ -248,8 +248,14 @@ class MyResearchController extends AbstractBase $logoutTarget = $this->getServerUrl('home'); } - // clear querystring parameters - $logoutTarget = preg_replace('/\?.*/', '', $logoutTarget); + // If there is an auth_method parameter in the query, we should strip + // it out. Otherwise, the user may get stuck in an infinite loop of + // logging out and getting logged back in when using environment-based + // authentication methods like Shibboleth. + $logoutTarget = preg_replace( + '/([?&])auth_method=[^&]*&?/', '$1', $logoutTarget + ); + $logoutTarget = rtrim($logoutTarget, '?'); } return $this->redirect()