[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /auth lonshibauth.pm

raeburn raeburn at source.lon-capa.org
Sun Dec 12 15:56:36 EST 2021


raeburn		Sun Dec 12 20:56:36 2021 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/auth	lonshibauth.pm 
  Log:
  - For 2.11
    Remove code which supports deep-linking features not included in 2.11  
  
  
Index: loncom/auth/lonshibauth.pm
diff -u loncom/auth/lonshibauth.pm:1.14 loncom/auth/lonshibauth.pm:1.14.2.1
--- loncom/auth/lonshibauth.pm:1.14	Sun Dec 12 20:49:26 2021
+++ loncom/auth/lonshibauth.pm	Sun Dec 12 20:56:36 2021
@@ -2,7 +2,7 @@
 # Redirect Single Sign On authentication to designated URL: 
 # /adm/sso, by default.
 #
-# $Id: lonshibauth.pm,v 1.14 2021/12/12 20:49:26 raeburn Exp $
+# $Id: lonshibauth.pm,v 1.14.2.1 2021/12/12 20:56:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -155,8 +155,7 @@
 which will contain either (a) the originally requested URL,
 if not /adm/sso (or lonOtherAuthenUrl URL), and 
 any existing query string in the original request, or
-(b) if original request was for /tiny/domain/uniqueID,
-or if redirect is to /adm/login to support dual SSO and
+(b) if redirect is to /adm/login to support dual SSO and
 non-SSO, a query string which contains sso=tokenID, where the
 token contains information for deep-linking to course/resource. 
 
@@ -193,14 +192,9 @@
 $querystring - query string to append to URL
 when redirecting.
 
-If any of the following items are present in the original query string:
-role, symb, and linkkey, then they will be stored in the token file
-on the server, for access later to support deep-linking.  If the ltoken
-item is available, from successful launch from an LTI Consumer where
-LON-CAPA is the LTI Provider, but not configured to accept user 
-information, and the destination is a deep-link URL /tiny/domain/uniqueiD,
-then the LTI number, type (c or d), and tiny URL will be saved as the
-linkprot item in a token file.
+If role and/or symb are present in the original query string:
+then they will be stored in the token file on the server,
+for access later to support deep-linking.
 
 =back
 
@@ -245,19 +239,12 @@
              }
         } else {
             my $uri = $r->uri;
-            if ($uri =~ m{^/tiny/$match_domain/\w+$}) {
-                my $querystring = &set_token($r,$lonhost);
-                if ($querystring ne '') {
-                    $dest .= '?'.$querystring;
-                }
-            } else {
-                if ($r->args ne '') {
-                    $dest .= (($dest=~/\?/)?'&':'?').$r->args;
-                }
-                unless (($uri eq '/adm/roles') || ($uri eq '/adm/logout')) {
-                    unless ($r->args =~ /origurl=/) {
-                        $dest.=(($dest=~/\?/)?'&':'?').'origurl='.$uri;
-                    }
+            if ($r->args ne '') {
+                $dest .= (($dest=~/\?/)?'&':'?').$r->args;
+            }
+            unless (($uri eq '/adm/roles') || ($uri eq '/adm/logout')) {
+                unless ($r->args =~ /origurl=/) {
+                    $dest.=(($dest=~/\?/)?'&':'?').'origurl='.$uri;
                 }
             }
         }
@@ -271,7 +258,7 @@
 sub set_token {
     my ($r,$lonhost) = @_;
     my ($firsturl,$querystring,$ssotoken, at names,%token);
-    @names = ('role','symb','ltoken','linkkey');
+    @names = ('role','symb');
     map { $token{$_} = 1; } @names;
     unless (($r->uri eq '/adm/roles') || ($r->uri eq '/adm/logout')) {
         $firsturl = $r->uri;
@@ -279,34 +266,10 @@
     if ($r->args ne '') {
         &Apache::loncommon::get_unprocessed_cgi($r->args);
     }
-    if ($r->uri =~ m{^/tiny/$match_domain/\w+$}) {
-        if ($env{'form.ttoken'}) {
-            my %info = &Apache::lonnet::tmpget($env{'form.ttoken'});
-            &Apache::lonnet::tmpdel($env{'form.ttoken'});
-            if ($info{'ltoken'}) {
-                $env{'form.ltoken'} = $info{'ltoken'};
-            } elsif ($info{'linkkey'} ne '') {
-                $env{'form.linkkey'} = $info{'linkkey'};
-            }
-        } else {
-            unless (($env{'form.ltoken'}) || ($env{'form.linkkey'})) {
-                &Apache::lonacc::get_posted_cgi($r,['linkkey']);
-            }
-        }
-    }
     my $extras;
     foreach my $name (@names) {
         if ($env{'form.'.$name} ne '') {
-            if ($name eq 'ltoken') {
-                my %info = &Apache::lonnet::tmpget($env{'form.ltoken'});
-                &Apache::lonnet::tmpdel($env{'form.ltoken'});
-                if ($info{'linkprot'}) {
-                    $extras .= '&linkprot='.&escape($info{'linkprot'});
-                    last;
-                }
-            } else {
-                $extras .= '&'.$name.'='.&escape($env{'form.'.$name});
-            }
+            $extras .= '&'.$name.'='.&escape($env{'form.'.$name});
         }
     }
     if (($firsturl ne '') || ($extras ne '')) {
@@ -319,7 +282,7 @@
         foreach my $key (sort(keys(%env))) {
             if ($key =~ /^form\.(.+)$/) {
                 my $name = $1;
-                next if (($token{$name}) || ($name eq 'ttoken'));
+                next if ($token{$name});
                 $querystring .= '&'.$name.'='.$env{$key};
             }
         }




More information about the LON-CAPA-cvs mailing list