Skip to content

Commit

Permalink
Ignore additional query parameters in initiate login requests using GET
Browse files Browse the repository at this point in the history
  • Loading branch information
spvickers committed Oct 14, 2021
1 parent 1340139 commit 0b9de87
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -1944,10 +1944,13 @@ private function sendAuthenticationRequest($parameters)
} else { // Remove all parameters added by platform from query string
$queryString = '';
$params = explode('&', $_SERVER['QUERY_STRING']);
$ignore = false; // Only include those query parameters which come before any of the standard OpenID Connect ones
foreach ($params as $param) {
$parts = explode('=', $param, 2);
if (!in_array($parts[0],
if (in_array($parts[0],
array('iss', 'target_link_uri', 'login_hint', 'lti_message_hint', 'client_id', 'lti_deployment_id'))) {
$ignore = true;
} elseif (!$ignore) {
if ((count($parts) <= 1) || empty($parts[1])) { // Drop equals sign for empty parameters to workaround Canvas bug
$queryString .= "&{$parts[0]}";
} else {
Expand Down

0 comments on commit 0b9de87

Please sign in to comment.