openequella / openEQUELLA

Core openEQUELLA sources
https://openequella.github.io/
Apache License 2.0
41 stars 44 forks source link

Canvas integration needs more custom parameters for proper LTI auth #586

Closed cbeach47 closed 5 years ago

cbeach47 commented 6 years ago

Integrating via the relative openEQUELLA config URL /lti/autoconfig creates a few integration flows, including:

The first two flows will log the user in as a temporary LTI..... user. The last flow will properly log the user in as the Canvas user.

The workaround to fix this is to add the following custom parameters to the LTI app for openEQUELLA in Canvas:

canvas_api_domain=$Canvas.api.domain
canvas_course_id=$Canvas.course.id
course_sis_id=$Canvas.course.sisSourceId
canvas_enrollment_state=$Canvas.enrollment.enrollmentState
canvas_user_id=$Canvas.user.id
canvas_user_login_id=$Canvas.user.loginId
canvas_course_workflow_state=$Canvas.course.workflowState

This issue is to add the custom parameters into the /lti/autoconfig XML:

    <blti:extensions platform="canvas.instructure.com">
    ...
      <blti:custom>
        <lticm:property name="course_id">$Canvas.course.sisSourceId</lticm:property>
        <lticm:property name="course_code">$com.instructure.contextLabel</lticm:property>

    <lticm:property name="canvas_api_domain">$Canvas.api.domain</lticm:property>
    <lticm:property name="canvas_course_id">$Canvas.course.id</lticm:property>
    <lticm:property name="course_sis_id">$Canvas.course.sisSourceId</lticm:property>
    <lticm:property name="canvas_enrollment_state">$Canvas.enrollment.enrollmentState</lticm:property>
    <lticm:property name="canvas_user_id">$Canvas.user.id</lticm:property>
    <lticm:property name="canvas_user_login_id">$Canvas.user.loginId</lticm:property>
    <lticm:property name="canvas_course_workflow_state">$Canvas.course.workflowState</lticm:property>
      </blti:custom>
      ...
    </blti:extensions>
cbeach47 commented 6 years ago

Further testing should be done to understand the difference between the following and which are needed in the oEQ integration.

course_id=$Canvas.course.sisSourceId
canvas_course_id=$Canvas.course.id
course_sis_id=$Canvas.course.sisSourceId

From Canvas Support:

Note that the current course_id param you have set up in your XML is actually the SIS ID, not the canvas_course_id

cbeach47 commented 6 years ago

Reviewed the code and parameters, and concluded the following. @abidingotter - do you agree?

LTI Parameter Breakdown Two parameters currently being sent via lti/autoconfig:

Used in CanvasLtiWrapperExtension to SSO a user If the user doesn't exist, creates the user if configured. If not included, a temp user starting with LTI:... will be created/used

Used in CanvasIntegration.
Not sure the significance of courseCodes (can you comment on this @abidingotter ? ).

Not in the Equella codebase (thus not needed)

Ensure All Canvas Integrations have the Following Custom LTI Parameters

cbeach47 commented 5 years ago

Merged into develop and cherry-picked into release/2019.1