--- loncom/lti/ltiauth.pm 2022/06/30 21:04:14 1.39 +++ loncom/lti/ltiauth.pm 2023/05/24 14:55:57 1.41 @@ -1,7 +1,7 @@ # The LearningOnline Network # Basic LTI Authentication Module # -# $Id: ltiauth.pm,v 1.39 2022/06/30 21:04:14 raeburn Exp $ +# $Id: ltiauth.pm,v 1.41 2023/05/24 14:55:57 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -146,7 +146,7 @@ sub handler { my ($itemid,$ltitype,%crslti,%lti_in_use,$ltiuser); $itemid = &get_lti_itemid($requri,$hostname,$params,$cdom,$cnum,'linkprot'); if ($itemid) { - %crslti = &Apache::lonnet::get_course_lti($cnum,$cdom); + %crslti = &Apache::lonnet::get_course_lti($cnum,$cdom,'provider'); } if (($itemid) && (ref($crslti{$itemid}) eq 'HASH')) { $ltitype = 'c'; @@ -1126,6 +1126,11 @@ sub check_balancer { ($is_balancer,$otherserver) = &Apache::lonnet::check_loadbalancing($uname,$udom,'login'); if ($is_balancer) { + # Check if browser sent a LON-CAPA load balancer cookie (and this is a balancer) + my ($found_server,$balancer_cookie) = &Apache::lonnet::check_for_balancer_cookie($r); + if (($found_server) && ($balancer_cookie =~ /^\Q$udom\E_\Q$uname\E_/)) { + $otherserver = $found_server; + } if ($otherserver eq '') { my $lowest_load; ($otherserver,undef,undef,undef,$lowest_load) = &Apache::lonnet::choose_server($udom);