From a94fb616bd33f9f591ee2adc7451559bec869d91 Mon Sep 17 00:00:00 2001 From: Maxime Besson Date: Fri, 9 Apr 2021 17:51:54 +0200 Subject: [PATCH] Allow admin to disallow host-based match (#2506) --- lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm index 8f6c9c2f0..9d9745d3e 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Lib/CAS.pm @@ -527,8 +527,10 @@ sub getCasApp { } } - # Try to match host - $hostnameConfKey = $app if ( $hostname eq $candidateHost ); + # Try to match host, only if strict matching is disabled + unless ( $self->conf->{casStrictMatching} ) { + $hostnameConfKey = $app if ( $hostname eq $candidateHost ); + } } # Application found by prefix has priority