[LON-CAPA-cvs] cvs: loncom /lti ltiauth.pm

raeburn raeburn at source.lon-capa.org
Sat Dec 9 11:15:47 EST 2017


raeburn		Sat Dec  9 16:15:47 2017 EDT

  Modified files:              
    /loncom/lti	ltiauth.pm 
  Log:
  Bug 6754 LON-CAPA as LTI Provider
   - More descriptive name for Consumer Key scalar.
   - Include LON-CAPA courseID in standard format when logging successful 
     authentication via basic LTI. 
  
  
Index: loncom/lti/ltiauth.pm
diff -u loncom/lti/ltiauth.pm:1.2 loncom/lti/ltiauth.pm:1.3
--- loncom/lti/ltiauth.pm:1.2	Thu Dec  7 15:36:25 2017
+++ loncom/lti/ltiauth.pm	Sat Dec  9 16:15:47 2017
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Basic LTI Authentication Module
 #
-# $Id: ltiauth.pm,v 1.2 2017/12/07 15:36:25 raeburn Exp $
+# $Id: ltiauth.pm,v 1.3 2017/12/09 16:15:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -241,10 +241,10 @@
         $protocol = 'https';
     }
 
-    my ($itemid,$key,$secret, at ltiroles);
-    $key = $params->{'oauth_consumer_key'};
-    if (ref($lti_by_key{$key}) eq 'ARRAY') {
-        foreach my $id (@{$lti_by_key{$key}}) {
+    my ($itemid,$consumer_key,$secret, at ltiroles);
+    $consumer_key = $params->{'oauth_consumer_key'};
+    if (ref($lti_by_key{$consumer_key}) eq 'ARRAY') {
+        foreach my $id (@{$lti_by_key{$consumer_key}}) {
             if (ref($lti{$id}) eq 'HASH') {
                 $secret = $lti{$id}{'secret'};
                 my $request = Net::OAuth->request('request token')->from_hash($params,
@@ -497,7 +497,7 @@
 # Check if user should be hosted here or switched to another server.
 #
 
-    &Apache::lonnet::logthis(" LTI authorized user: $uname:$udom role: $role course: $cnum:$cdom");
+    &Apache::lonnet::logthis(" LTI authorized user: $uname:$udom role: $role course: $cdom\_$cnum");
     $r->user($uname);
     my ($is_balancer,$otherserver,$hosthere);
     ($is_balancer,$otherserver) =




More information about the LON-CAPA-cvs mailing list