Skip to content

Feature: LTI third-party-auth providers - #8930

Merged
cpennington merged 2 commits into
openedx:masterfrom
ubc:wmono/lti-sso
Sep 4, 2015
Merged

Feature: LTI third-party-auth providers#8930
cpennington merged 2 commits into
openedx:masterfrom
ubc:wmono/lti-sso

Conversation

@wmono

@wmono wmono commented Jul 14, 2015

Copy link
Copy Markdown
Contributor

Based on top of PR #8140, this change permits Learning Tools Interoperability (LTI) tool consumer applications to perform a session transfer into edX instances.

As the LTI login process is significantly different from other python-social auth providers (in particular, logins cannot be initiated by the application as there is no login page to redirect to) this auth provider has been added to third-party-auth instead.

Background reading: Basic LTI implementation guide

To test this change, first configure a LTI tool consumer in the Django admin interface, making up a consumer key and consumer secret as one would for an OAuth auth provider, then use the LTI tool consumer reference implementation to launch https://yourserver.example.com/auth/login/lti/ . The trailing slash is mandatory.

Unfortunately, the consumer/provider names can be awkward: edX is acting as an LTI tool provider -- that is, it is providing itself as a tool to an external tool consumer application -- but it does so by accepting that tool consumer as a third-party-auth auth provider.

We've been working with @ebporter on this change. Please note that this change is distinct from the similar work in PR #8347 as this one creates/associates fully functional users; the intent here is to use LTI as a session transfer mechanism, whereas the intent there is to embed edX into another application. Further work to merge these two approaches is under discussion.

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @wmono! I've created OSPR-700 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams.

Feel free to add as much of the following information to the ticket:

  • supporting documentation
  • edx-code email threads
  • timeline information ('this must be merged by XX date', and why that is)
  • partner information ('this is a course on edx.org')
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will still be done via the Github pull request interface. As a reminder, our process documentation is here.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U needs triage labels Jul 14, 2015
@wmono

wmono commented Jul 14, 2015

Copy link
Copy Markdown
Contributor Author

Please note that UBC has a blanket contributor agreement with edX and an individual contributor agreement is not required.

@sarina

sarina commented Jul 15, 2015

Copy link
Copy Markdown
Contributor

@wmono yep, we've got that noted! There's a merge conflict here and I strongly suspect it's with AUTHORS. Since that file changes so frequently, I would recommend you simply make a separate PR for the Update AUTHORS commit, so we can just quickly get that merged for you.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: So that future import changes create a clean diff, I prefer doing

from some_lib import (
    thing1,
    thing2,
)

@sarina

sarina commented Jul 15, 2015

Copy link
Copy Markdown
Contributor

@wmono You have a few javascript test failures, and I know you're going to fail the quality checks.

See here for more info on quality testing

Here's how to run javascript tests locally

@openedx-webhooks openedx-webhooks added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed community manager review labels Jul 15, 2015
@wmono wmono mentioned this pull request Jul 15, 2015
@wmono

wmono commented Jul 16, 2015

Copy link
Copy Markdown
Contributor Author

Er, how do I prevent this test timeout?

@wmono

wmono commented Jul 16, 2015

Copy link
Copy Markdown
Contributor Author

Jenkins, please rebuild?

@bradenmacdonald

Copy link
Copy Markdown
Contributor

@wmono FYI you can now ask Jenkins to re-run each individual part (e.g. just re-run bok choy): https://openedx.atlassian.net/wiki/display/TE/Jenkins+Guide

@bradenmacdonald

Copy link
Copy Markdown
Contributor

@wmono et al. I think this PR needs to be updated to not [necessarily] store the lti_consumer_secret in the DB, as was done recently for other third party auth providers - see the now-public security fix at https://github.com/edx/edx-platform/pull/9471 (CVE-2015-6671). There is concern that storing secrets in the DB increases surface area for attacks in the event that a DB/backup/replica is compromised. (If for some reason that's not a concern, it should be documented here.)

@cpennington

Copy link
Copy Markdown
Contributor

@sarina @wmono I agree with @bradenmacdonald, and also would like the fixups squashed, and then I think it's ready to be merged.

@sarina

sarina commented Sep 2, 2015

Copy link
Copy Markdown
Contributor

@wmono Once you have responded to Braden and Cale's comments, please make a comment on this PR to ask them to look again - remember that we do not get notifications for new commits pushed, only for comments made.

@openedx-webhooks openedx-webhooks added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed awaiting prioritization labels Sep 2, 2015
@wmono

wmono commented Sep 3, 2015

Copy link
Copy Markdown
Contributor Author

@bradenmacdonald Does this change resolve your security concern?

@bradenmacdonald

Copy link
Copy Markdown
Contributor

@wmono The code looks good. I'm not able to test it right now but I can do that later if needed.

@wmono

wmono commented Sep 3, 2015

Copy link
Copy Markdown
Contributor Author

jenkins run bokchoy

1 similar comment
@wmono

wmono commented Sep 4, 2015

Copy link
Copy Markdown
Contributor Author

jenkins run bokchoy

@bradenmacdonald

Copy link
Copy Markdown
Contributor

@wmono Just went to test this, but the security fix is not working for me. I think you need blank=True on the field in your model definition.

screen shot 2015-09-03 at 5 58 16 pm

@bradenmacdonald

Copy link
Copy Markdown
Contributor

@wmono I added blank=True locally and then everything was working fine, so my +1 stands if you fix that little issue and confirm yourself that it's working whether or not the key is in the database.

@wmono

wmono commented Sep 4, 2015

Copy link
Copy Markdown
Contributor Author

jenkins run bokchoy

@sarina

sarina commented Sep 4, 2015

Copy link
Copy Markdown
Contributor

jenkins run bokchoy last build failure

@cpennington

Copy link
Copy Markdown
Contributor

@wmono: Can you write up a documentation on how this needs to be configured? @feanil, I'm going to merge this, since it's passing builds, but I think it's going to need ConfigModel and secure keys changes to go live.

cpennington added a commit that referenced this pull request Sep 4, 2015
Feature: LTI third-party-auth providers
@cpennington
cpennington merged commit 7c62d09 into openedx:master Sep 4, 2015
@feanil

feanil commented Sep 4, 2015

Copy link
Copy Markdown
Contributor

Good to know. Thanks Cale. @ebporter I'll follow up with you to figure out the details of going live with this code.

@sarina

sarina commented Sep 8, 2015

Copy link
Copy Markdown
Contributor

@feanil can you tag me on any ops tickets re the configuration work needed to get this live?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In retrospect, looking at this model, and running through the configuration on stage, could/should we replace these two fields with a foreign key to the existing LTI provider table?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is really just a copy/paste of the Key/Secret from the LTI Consumer page, then absolutely, this should be a dropdown list of LTI Consumers that you pick from. It also shouldn't generate a suggested lti_consumer_secret (default=long_token) since you're using one you already generated.

This lti_consumer_secret does all the work needed to save the secret to disk (rather than DB) but the other LTI Consumer does none of it, so we'd potentially have the secret in the DB for that table and on disk for this table, which seems strange.

@wmono Can you confirm if an LTI SSO secret/key pair should be identical to the keypair used for the consumer or if they must/should be different?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jibsheet If you are absolutely certain that you will never have a different set of LTI TCs between the two ways of consuming edX, then yes, you can make this change if you like. Note that the level of trust involved is quite different: with this one, the TC causes a sign-in of a real user, while the other one creates a separate user.

@rukhsarahmad-gep

Copy link
Copy Markdown

need help on edx.org integration with litmos. please share link if you have. is it straight forward configuration on UI? or we have to call REST API to get authentication & display course list?

@nedbat

nedbat commented Nov 15, 2017

Copy link
Copy Markdown
Contributor

@RukhsarAhmad Commenting on pull requests isn't a good way to get help. See here for options: https://open.edx.org/getting-help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.