From f898ece1b1a399a949463485814358d779943ce7 Mon Sep 17 00:00:00 2001 From: oajulianclementson <51331324+oajulianclementson@users.noreply.github.com> Date: Fri, 31 Jan 2020 22:51:35 +0000 Subject: [PATCH] LP#1842297: Allow for login redirect with hostname --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/OpenAthens.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/OpenAthens.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/OpenAthens.pm index f5837400ed..4a5af936b9 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/OpenAthens.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/OpenAthens.pm @@ -63,6 +63,12 @@ sub perform_openathens_sso_if_required { && $U->is_true($openathens_config->{active}) && $U->is_true($openathens_config->{auto_signon_enabled}) ) { + # Remove scheme and hostname from redirect_to (this may have been set + # by the login form, but isn't allowed by the OpenAthens SSO page) + if ($redirect_to =~ m#^https?://\Q$ctx->{hostname}\E(.+)#) { + $redirect_to = $1; + } + my $redirect = $ctx->{opac_root} . '/sso/openathens?redirect_to=' . uri_escape_utf8($redirect_to); -- 2.11.0