jramnai
(JayRam Nai)
March 21, 2022, 9:10am
1
Hello All,
We are trying to integrate Mettl (LTI Provider) with Open edX (LTI Consumer) on the open-release/lilac.master
release.
And for the testing purpose, we are using webhook.site . While performing the test from webhook.site we found out that if we launch LTI component (View resource in a new window) from the studio, on provider side we are getting resource_link_id: -76c71cb1a3a74750bc8a0bbc60ebd438
And if we launch the same LTI component from LMS side then getting resource_link_id: localhost%3A18000-76c71cb1a3a74750bc8a0bbc60ebd438
.
Now, due to this resource_link_id
mismatch, we are not able to complete our integration (as per the LTI Provider, resource_link_id
should be the same on both sides).
Can anyone please help me out?
And we also tried to look into the code base and the following are the findings:
First part of location is tag-org-course-category, i4x-2-3-lti.
Location.name itself does not change on import to another course,
but org and course_id change.
So together with org and course_id in a form of
i4x-2-3-lti-31de800015cf4afb973356dbe81496df this part of resource_link_id:
makes resource_link_id to be unique among courses inside same system.
"""
return str(urllib.parse.quote(
f"{self.runtime.hostname}-{self.location.html_id()}" # pylint: disable=no-member
))
@property
def lis_result_sourcedid(self):
"""
This field contains an identifier that indicates the LIS Result Identifier (if any)
associated with this launch. This field identifies a unique row and column within the
TC gradebook. This field is unique for every combination of context_id / resource_link_id / user_id.
This value may change for a particular resource_link_id / user_id from one launch to the next.
The TP should only retain the most recent value for this field for a particular resource_link_id / user_id.
Over here on xblock-lti-consumer, from the studio side, we are getting PreviewModuleSystem (w/o value of hostname and HOST) and from the LMS side, we are getting LmsModuleSystem (with the value of hostname and HOST).
2 Likes
jramnai
(JayRam Nai)
March 23, 2022, 3:29pm
2
@giovannicimolin , pinging you here as you have recently worked on LTI.
1 Like
giovannicimolin
(Giovanni Cimolin (OpenCraft) - https://opencraft.com/help)
May 5, 2022, 2:28pm
3
@jramnai I just bumped into a discussion related to this, with a possible fix incoming.
Please review the comments on this PR:
openedx:master
← open-craft:tecoholic/BB-6144-deprecate-hostname-in-ModuleSystem
opened 03:51AM - 25 Apr 22 UTC
## Description
The `hostname` attribute was needed for OAuth in the LTI Modul… e and was
being passed via the `x_module.ModuleSystem` class as a mixin. This attribute has been removed.
It has been replaced in the `xmodule.lti_module` with `get_current_request_hostname` utility function.
This change affects only the `module_renderer` module of the LMS which is also updated to initialize the XBlocks without passing the hostname attribute anymore.
This shouldn't cause any changes for any users and should continue to work just as usual.
## Supporting information
- Related OpenCraft Issue - https://tasks.opencraft.com/browse/BB-6144
## Testing instructions
1. Set your dev environment to `master` branch.
2. Add `"lti"` to the **Advanced Module List** in the **Advanced Settings**. (NOT `lti_consumer` which is an independent xblock, this PR deals with the old `lti` module)
3. Scroll down to **LTI Passports** and add a new entry `"saltire:consumer_key:secret"`. We will be using the [Saltire Tool Emulator](https://saltire.lti.app/tool) to test the changes
4. **Save Changes**
5. Add a new new unit to your test course and select **Advanced** -> **LTI**
6. Click **Edit** and enter the following details and save the block
* **LTI ID**: `saltire`
* **LTI URL**: `https://saltire.lti.app/tool`
* **Open in New Page**: `False`
7. Once Saltire loads in the block, make sure **Verification** is show as `Passed`
8. Save and publish the unit.
9. Open the unit in LMS and expand the **Message Parameters** in the Saltire Block. Note the value of `resource_link_id`. It should be something like `{hostname}-{random-hash-value}`. Eg., when testing from local devstack `localhost%3A18000-71e809b7a55442afaa590a477145bb6c`
10. Now checkout the `edx-platform` to the PR branch `open-craft:tecoholic/BB-6144-deprecate-hostname-in-ModuleSystem`
11. Restart your studio & lms services to make sure they are loading the changes from PR.
12. Refresh the LMS page with Saltire and expand the **Message Parameters** once again
13. Compare the `resource_link_id` show with the old value. Both should have the same `{hostname}` part.
14. You can create a new Unit + LTI Block after the PR branch has been checked out to ensure `hostname` value is populated as expected.
system
(system)
Closed
August 3, 2022, 2:28pm
4
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.