fix(lti13): Fix protocol for redirect_uri if behind a reverse proxy with TLS termination #165
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If JupyterHub is behind a reverse proxy, protocol used in redirect URI may be wrong. Typically, user agent und proxy communicate via HTTPS, whereas proxy and hub communicate via HTTP. Up to now HTTP will make it into the redirect URI although the redirect URI will be visited by the user agent. Thus, LTI platform will complain about incorrect redirect URI.
This PR fixes the problem. Similar situations occur in other handlers and work correctly, see
handlers.py
, line 66 for instance.I tested the proposed modification on my setup (HTTPS, reverse proxy , Moodle as LTI platform), but do not have a complete dev environment in this setup . Thus, I did not run automatic tests.
Someone having deeper insight into the ltiauthenticator code should carefully check the proposed modification @martinclaus ?
Many thanks and best regards,
Jens