--- loncom/lti/ltiauth.pm 2018/05/08 00:44:14 1.10 +++ loncom/lti/ltiauth.pm 2018/05/14 20:10:15 1.12 @@ -1,7 +1,7 @@ # The LearningOnline Network # Basic LTI Authentication Module # -# $Id: ltiauth.pm,v 1.10 2018/05/08 00:44:14 raeburn Exp $ +# $Id: ltiauth.pm,v 1.12 2018/05/14 20:10:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -294,6 +294,12 @@ sub handler { $protocol = 'https'; } + if (exists($params->{'oauth_callback'})) { + $Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0A; + } else { + $Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0; + } + my ($itemid,$consumer_key,$secret); $consumer_key = $params->{'oauth_consumer_key'}; if (ref($lti_by_key{$consumer_key}) eq 'ARRAY') { @@ -432,7 +438,7 @@ sub handler { my @lcroleorder = ('cc','in','ta','ep','st'); my @ltiroleorder = ('Instructor','TeachingAssistant','Mentor','Learner'); if ($params->{'roles'} =~ /,/) { - my @possltiroles = split(/\s*,\s*/,$params->{'role'}); + my @possltiroles = split(/\s*,\s*/,$params->{'roles'}); foreach my $ltirole (@ltiroleorder) { if (grep(/^\Q$ltirole\E$/,@possltiroles)) { push(@ltiroles,$ltirole);