Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-64152

LTI v1: provider under web proxy doesn't work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.4.5
    • Fix Version/s: None
    • Labels:
    • Affected Branches:
      MOODLE_34_STABLE

      Description

      I tried to jump from a Moodle 3.4.5 (say A, or LTI client) to another instance Moodle 3.4.5 (say B, or LTI provider) via LTI v1, after setting up all parameters for both instances I couldn't go from A to B because of this:

      File: lib/ltiprovider/src/OAuth/OAuthRequest.php
      Method: from_request()
      Line: 41

      rebuilds the LTI provider via the superglobal $_SERVER, using the keys HTTPS + SERVER_NAME + SERVER_PORT + REQUEST_URI. 

      In our case, since Moodle B works under a web proxy, the URL of the Moodle itself on B is not build properly (in our case, the port was not the default 443), so the `$base_string` contains a diferent web port from that received from the client, and resulting on different signatures (that from the client, and the $built from the LTI provider). The error shown on B is: "Debug error: Invalid signature"

      Moodle works ok under web proxy (like variables $ME, $FULLME), but not this LTI part.

      I overpassed this bug, debugging step by step, and setting the expected value on the LTI provider URL. Then, I found that our web proxy had a $_SERVER['HTTP_ORIGIN'] that contained the scheme + server + port parts properly configured, so made a local change on that, just to verify that this was the exact problem.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jpahullo Jordi Pujol-Ahulló
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            • Votes:
              9 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: