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:
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.