Skip to content
Snippets Groups Projects
  1. Dec 15, 2022
    • michaelroytman's avatar
    • michaelroytman's avatar
      feat: enable sharing username, email in LTI 1.3 launches and support blocking PII transmission · a7fcf621
      michaelroytman authored
      This commit enables sharing username and email in LTI 1.3 basic launches.
      
      This commit adds preferred_username and email as attributes of the Lti1p3LaunchData. The application or context that instantiates Lti1p3LaunchData is responsible for ensuring that username and email can be sent via an LTI 1.3 launch and supplying these data, if appropriate.
      
      This commit sends username and email as part of an LTI 1.3 basic launch when the XBlock fields ask_to_send_username and ask_to_send_email are set to True, respectively.
      
      Code was also added to block the transmission of username and email in both LTI 1.1 and LTI 1.3 launches if the value of the lti_access_to_learners_editable method of the LTI configuration service (i.e. the value of the CourseAllowPIISharingInLTIFlag ConfigurationModel) returns False, as originally intended and documented in the "Unified Flag for Enabling Sharing of PII in LTI
      " decision record. However, the LTI configuration service is not currently available or defined in all runtime contexts, so this behavior only works when editing the XBlock in Studio (i.e. the studio_view). It does not work from the XBlock preview in Studio (i.e. the author_view) or from the LMS (i.e. the student_view).
      
      The impact of this is that the ask_to_send_username and ask_to_send_email fields will be hidden in LTI XBlocks in courses for which an instance of the CourseAllowPIISharingInLTIFlag ConfigurationModel does not exist or for which an existing instance of the CourseAllowPIISharingInLTIFlag ConfigurationModel is disabled. If there already exists an instance of the CourseAllowPIISharingInLTIFlag ConfigurationModel for a course, then disabling the flag will only hide the ask_to_send_username and ask_to_send_email in the LTI XBlock edit menu. It will not prevent the transmission of username or email via the launch in Studio preview or via the launch in the LMS. If a course has already set ask_to_send_username or ask_to_send_email to True in the XBlock edit menu, that information will continue to be sent via the LTI 1.1 or LTI 1.3 launch.
      
      We plan to fix this bug in the future.
      a7fcf621
    • michaelroytman's avatar
      fix: LTI 1.1 form URL is relative URL and LTI 1.3 form URL is expected to be absolute · e1e0f131
      michaelroytman authored
      This commit fixes a bug in the way that the the form_url is used in the Javascript.
      
      For LTI modal launches in the courseware microfrontend (MFE), the Javascript prepends the value of window.location.origin to the form_url when sending a message via postMessage to window.parent.
      
      This is because the form_url included in the template by the XBlock handler does not include a port and hostname for LTI 1.1 launches.
      
      In LTI 1.3, however, the form_url should include the port and hostname, because it's user input (e.g. fields on the XBlock). Because of this, LTI 1.3 modal launches do not work, because the Javascript appends a port and hostname to a URL that already has a port and hostname, resulting in something like "http://localhost:18000http//localhost..."
      
      This commit changes the way that the launch URL is calculated by the Javascript. The version of LTI being used is included in the template by the Python code, which is read by the Javascript. The Javascript then adds the port and hostname for LTI 1.1 form URLs but not for LTI 1.1 form URLs.
      e1e0f131
    • michaelroytman's avatar
      fix: remove caching for lti_access_to_learners_editable · d70de329
      michaelroytman authored
      This commit removes the request_cached decorator on the method lti_access_to_learners_editable. The caching was not working correctly. It appeared that the cached value was not being recomputed on a per-request basis, which meant that the cached value was not successfully being updated. Also, the initial cached value was computed incorrectly. The effect was that the PII sharing XBlock fields were always being displayed in Studio and CourseAllowPIISharingInLTIFlag instances were not being created for courses that had PII sharing XBlocks that did not already have CourseAllowPIISharingInLTIFlag instances.
      
      Note that this commit fixes the backwards compatibility of the CourseAllowPIISharingInLTIFlag. This means that CourseAllowPIISharingInLTIFlag will now be created for all courses that contain an LTI XBlock that shares username and/or email for which a CourseAllowPIISharingInLTIFlag does not already exist.
      
      Time was spent on determining why the caching was failing, but it was challenging. If the issue is in the request_cached decorator, then the impact of changing it is large - it's used elsewhere in the platform. The need for a fix was urgent, and the supposed performance enhancement of leaving the caching in doesn't justify delaying a fix.
      d70de329
    • michaelroytman's avatar
      feat: replace PII consent modal with inline PII consent dialog and show for all LTI launch types · 8e357d40
      michaelroytman authored
      This commit replaces the consent modal that appears before personally identifiable information (PII) is shared via an LTI launch with an inline consent dialog. The consent dialog better supports the three LTI launch types (i.e. inline, modal, and new_window). This commit also fixes a bug where the PII consent modal was not being displayed for inline or modal launches.
      8e357d40
  2. Dec 09, 2022
  3. Dec 02, 2022
  4. Nov 29, 2022
  5. Nov 28, 2022
    • Arunmozhi's avatar
      refactor: replace oauth param fetching from client to signature method · 4e388eac
      Arunmozhi authored
      The OAuthlib 1.0 Client's get_oauth_params fails when processing Webob
      request object with the body stored as a binary instead of string.
      This commit replaces the client function with a different one which
      doesn't involve body hashing, as the body hash is calculated explicitly.
      4e388eac
  6. Nov 21, 2022
  7. Nov 18, 2022
    • michaelroytman's avatar
      feat: add course flag to send external_user_id as user_id in LTI 1.1 XBlock launches · cff7744e
      michaelroytman authored
      This commit introduces a new CourseWaffleFlag lti_consumer.enable_external_user_id_1p1_launches. When this flag is enabled for a course, LTI 1.1 XBlock launches in that course will send the user's external_user_id as the user_id attribute of the launch. external_user_id is the user's external user ID as defined, created, and stored by the external_user_ids Djangoapp in the edx-platform. When this waffle is not enabled for a course - the default case - LTI 1.1 XBlock launches in that course will continue to send the user's anonymous_user_id as the user_id attribute of the launch, as before.
      
      This provides an opt-in opportunity for courses to send a consistent, static, and opaque user identifier in an LTI 1.1 XBlock launch. This may be necessary for integration with LTI tools that require such an identifier.
      
      Please be aware that toggling this flag in a running course carries the risk of breaking the LTI integrations in the course. This flag should also only be enabled for new courses in which no LTI attempts have been made.
      cff7744e
  8. Nov 16, 2022
  9. Nov 09, 2022
Loading