From: oajulianclementson <51331324+oajulianclementson@users.noreply.github.com> Date: Fri, 31 Jan 2020 22:51:35 +0000 (+0000) Subject: LP#1842297: Allow for login redirect with hostname X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7b14e0e44cd6ffbb6026068e31e116c978e10421;p=evergreen%2Fpines.git LP#1842297: Allow for login redirect with hostname --- 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);