Clarification on external tool launch flow

Clarification on external tool launch flow

av Paul Tyson -
Antall svar: 3

We're implementing an LTI-compliant tool. We don't have any experience with Moodle or LTI, but do know about various OIDC authentication flows.

Does the Moodle external tool launch flow look like Figure 7 in the LTI security spec? The end user (who has presumably authenticated with Moodle) will be prompted again to login at the tool using Moodle as the OIDC provider. Then Moodle will construct an id_token with complete launch parameters and send to the tool.

If this isn't right, can you describe the flow in some technical detail? Or point to any Moodle technical documentation describing the LTI integration.

Gjennomsnittlig vurdering: -
Som svar til Paul Tyson

Re: Clarification on external tool launch flow

av Tim Hunt -
Bilde av Core developers Bilde av Documentation writers Bilde av Particularly helpful Moodlers Bilde av Peer reviewers Bilde av Plugin developers
Note that LTI is a standard that can be used to launch a tool from any LMS. So, you should not ask "Does Moodle ...", you should ask "Does the tool consumer ...".

Of course, Moodle is free, so I guess it is a useful option to test the tool you are developing with.

The whole point of LTI is that the user will not be prompted again to log in. I should appear seamless.

My suggestion to help you understand this is to find a existing (free) LTI tool, and connect it to a test Moodle install (you could use the test site at https://sandbox.moodledemo.net/). Then go in as a student and launch the tool, while watching the Network tab in the web browser developer tools. That will show you what then launch is.

I don't know of a good free LTI tool to recommend for testing this, but while I was searching for one, I fould this, which might be helpful: https://github.com/SanDiegoCodeSchool/lti-node-example
Som svar til Paul Tyson

Re: Clarification on external tool launch flow

av John Doyle -
Building on Tim's tips:
  • Yes, Moodle follows the auth flow in the spec you referenced
  • Yes, the user is typically already authenticated/logged-in on the Moodle/platform side when using an LTI tool (external tool) and it isn't common for the user to manually login to the tool separately as part of the LTI 1.3/OIDC flow
    • The tool still controls what's required after successful LTI auth in order to interact with the requested tool resources/content/etc.
    • Example: the LTI resource request sent after the LTI auth will include user data. This data can be used to create a user account on the tool side, lookup/find an existing user, assign the right role/capabilities to a user, etc. But perhaps something else is required, like tool-specific profile info or a tool-specific code to access a resource, before the resource can be served. The tool would handle these situations with direct user interaction.
  • Even with the public standard/specs, tool can't assume every standard LTI 1.3 request or situation will be handled perfectly by every platform, even when intent is there. Sometimes there's a tool issue, sometimes a platform issue.
    • Suggestion: Test the tool on multiple platforms before a prod launch - or at least test it on the platform(s) your customers/prospects will be using most frequently - Moodle, Canvas cloud or community, D2l/Brightspace, Schoology, Blackboard,etc. 
  • Any mention above of platform = LTI tool consumer, but not oAuth/OIDC consumer.  LTI 1.1 uses tool consumer, 1.3 uses  platform to avoid conflict with the oAuth/OIDC consumer - more info here

Hope it goes well!

Som svar til John Doyle

Re: Clarification on external tool launch flow

av Paul Tyson -
Tim and John, thanks for the helpful replies.

We use Spring Security framework to implement authentication. In our use cases so far we haven't needed the OIDC implicit flow, and it looks like Spring6 has removed support for it.
 
It seems like supplying a bearer token in the Authorization header of the tool launch request would be the cleanest way to do this, but the LTI specs don't mention this (that I've found).