Request hostname changing during LTI 1.3 launch sequence

marcspringshare
Community Explorer

Hi all,

We are developing a 1.3 version of our existing LTI tool for Canvas and other LMS, but implementation is proving difficult.

We are running the 2020-09-09 release on a Bitnami provided AWS EC2 instance, and we access Canvas via the EC2 hostname provided by AWS.  When I launch the tool in an attempt to add an new link to the MOdules section of Canvas I am taken through the following sequence:

GET http://ec2-1-2-3-4.compute-1.amazonaws.com/courses/1/external_tools/19/resource_selection 
placement=resource_selection
secure_params=undefined
context_module_id=1

POST https://my.tool.domain/lti1p3/login/981 
iss=https://canvas.instructure.com
login_hint=b582bed226a0c6e204b6b811cf8a37e7b2f8b0ce
client_id=10000000000008
target_link_uri=https://my.tool.domain/lti1p3/launch/981
lti_message_hint=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJpZmllciI6ImRkZDExM2ViZjUzNDMxNWI3YjJiNWNiZDFjM2NlMDg2ODkyNTZjYzgxZTZlMGQwNjVkNzYwMzhlNjMwMThjZGIxNmY5MDFiNmI3NzY3OGQ0YmFhOGM0YmZlYWU2NzNlYTNjNjk1NjAyYmJiZmQ4Y2RkNjAyNjJhMGJlMTMyYzVmIiwiY2FudmFzX2RvbWFpbiI6IjU0LjgzLjIzMi4zOCIsImNvbnRleHRfdHlwZSI6IkNvdXJzZSIsImNvbnRleHRfaWQiOjEwMDAwMDAwMDAwMDAxLCJleHAiOjE2MDUzMDcwNTZ9.Rc-81tY4AquzAHvSnZhw1eiz28M2GhAyl-FkMRGDvtg
canvas_region=not_configured

GET http://ec2-1-2-3-4.compute-1.amazonaws.com/api/lti/authorize_redirect 
scope=openid
response_type=id_token
response_mode=form_post
prompt=none
client_id=10000000000008
redirect_uri=https%3A%2F%2Fmy.tool.domain%2Flti1p3%2Flaunch%2F981
state=state-5faf09853db303_54805647
nonce=nonce-5faf09853db4e6.56249148
login_hint=b582bed226a0c6e204b6b811cf8a37e7b2f8b0ce
lti_message_hint=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJpZmllciI6ImRkZDExM2ViZjUzNDMxNWI3YjJiNWNiZDFjM2NlMDg2ODkyNTZjYzgxZTZlMGQwNjVkNzYwMzhlNjMwMThjZGIxNmY5MDFiNmI3NzY3OGQ0YmFhOGM0YmZlYWU2NzNlYTNjNjk1NjAyYmJiZmQ4Y2RkNjAyNjJhMGJlMTMyYzVmIiwiY2FudmFzX2RvbWFpbiI6IjU0LjgzLjIzMi4zOCIsImNvbnRleHRfdHlwZSI6IkNvdXJzZSIsImNvbnRleHRfaWQiOjEwMDAwMDAwMDAwMDAxLCJleHAiOjE2MDUzMDcwNTZ9.Rc-81tY4AquzAHvSnZhw1eiz28M2GhAyl-FkMRGDvtg

GET http://1.2.3.4/api/lti/authorize 
client_id=10000000000008
login_hint=b582bed226a0c6e204b6b811cf8a37e7b2f8b0ce
lti_message_hint=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJpZmllciI6ImRkZDExM2ViZjUzNDMxNWI3YjJiNWNiZDFjM2NlMDg2ODkyNTZjYzgxZTZlMGQwNjVkNzYwMzhlNjMwMThjZGIxNmY5MDFiNmI3NzY3OGQ0YmFhOGM0YmZlYWU2NzNlYTNjNjk1NjAyYmJiZmQ4Y2RkNjAyNjJhMGJlMTMyYzVmIiwiY2FudmFzX2RvbWFpbiI6IjU0LjgzLjIzMi4zOCIsImNvbnRleHRfdHlwZSI6IkNvdXJzZSIsImNvbnRleHRfaWQiOjEwMDAwMDAwMDAwMDAxLCJleHAiOjE2MDUzMDcwNTZ9.Rc-81tY4AquzAHvSnZhw1eiz28M2GhAyl-FkMRGDvtg
nonce=nonce-5faf09853db4e6.56249148
prompt=none
redirect_uri=https%3A%2F%2Fmy.tool.domain%2Flti1p3%2Flaunch%2F981
response_mode=form_post
response_type=id_token
scope=openid
state=state-5faf09853db303_54805647

At this point I am shown the following error message in Firefox.  Clicking the "Open site..." button generates this final request:

marcspringshare_0-1605307237879.jpeg

POST https://my.tool.domain/lti1p3/launch/981 
utf8=✓
authenticity_token=mlnx+Ut8PiFLeFLmcREqCvw1C5c/p6jwo186h/XTfbzQO7+JeShVaS45FpFFcG9NynE821jk3rj6CHzTgaAO3w==
error=login_required
error_description=Must have an active user session
state=state-5faf09853db303_54805647

 

So...a lot going on there.  The first thing that jumps out at me is that when going from /api/lti/authorize_redirect to /api/lti/authorize on the Canvas end, the domain changes from the machine hostname to its IP address.  I don't know if that is problematic, but it is a question for sure.

 

Labels (2)
0 Likes